Jump to content

GCC/G++ command not recognised in VS Code but recognised in command prompt

Go to solution Solved by BobVonBob,

Run VS Code from a terminal (Command Prompt, PowerShell, etc.) using the command "code". That should refresh the environment variables, then you can run it from any shortcuts you already had.

Hi. I have installed MinGW on my machine and added it to my PATH, and the commands work in command prompt but in VS Code they are not recognised:

 

VS Code:

jdw3ANBOC6.png

 

Command Prompt:

IR0vefkBOH.png

 

My environment variables:

image.png.87ed19087c7badde23227d7229865884.png

 

How come this doesn't work?

CPU: Intel Core i7 8700  

GPU: Gigabyte GeForce GTX 1070

MOBO: ASUS Z370-F STRIX  

RAM: 16GB Corsair Vengeance DDR4 2133MHz

Link to comment
Share on other sites

Link to post
Share on other sites

Run VS Code from a terminal (Command Prompt, PowerShell, etc.) using the command "code". That should refresh the environment variables, then you can run it from any shortcuts you already had.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, BobVonBob said:

Run VS Code from a terminal (Command Prompt, PowerShell, etc.) using the command "code". That should refresh the environment variables, then you can run it from any shortcuts you already had.

Thank you!

CPU: Intel Core i7 8700  

GPU: Gigabyte GeForce GTX 1070

MOBO: ASUS Z370-F STRIX  

RAM: 16GB Corsair Vengeance DDR4 2133MHz

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×