Although an old question, none of the answers here helped me. The only route I found to get to my destination is by typing in the following line in my command prompt:
set Path=C:\MinGW\bin;%PATH%
After that, simply type in gcc -v.
Hope this helps anyone with the problem I had!
Answer from user7943 on Stack OverflowAlthough an old question, none of the answers here helped me. The only route I found to get to my destination is by typing in the following line in my command prompt:
set Path=C:\MinGW\bin;%PATH%
After that, simply type in gcc -v.
Hope this helps anyone with the problem I had!
In my case, the C:\msys64\mingw64\bin was empty.
And gcc was installed at C:\msys64\ucrt64\bin
So, adding C:\msys64\ucrt64\bin to Path variable worked for me.
How do I go about compiling a simple c++ source file using my windows compiler?
I'm using ConEmu as a compiler.
[ANSWERED]
Im trying to run C on sublime text3
I've add the folder to gcc.exe to PATH
(Copying information from comments.)
The fact that your C:\MinGW\bin directory is nearly empty (that's where gcc.exe and g++.exe should be) indicates that you haven't finished installing MinGW.
See MinGW's Getting Started page for instructions.
For those who have mingw codeblocks installed, they should add this path to PATH variable in environment variables after a semicolon :
C:\Program Files (x86)\CodeBlocks\MinGW\bin
May vary with your install directory of Codeblocks
Also i have observed that if u have two paths for maybe two gcc installations in PATH variable in environment variables; You will still encounter the msg :
gcc is not recognised as an internal or external command
Hey,,, It will work for you I believe
Blockquote
- First: open the link: https://www.msys2.org/
- Go to the installation and download the installer .. install the exe file.
- search mingw in windows search(windows start)
- there is an app named--> MSYS2 MinGW {64/32}-bit
- run it as administrator
- Found command shell ---> type: pacman -Syu
- Will ask you for some installation click on Y
- Then again go to the same app MSYS2 MinGW {64/32}-bit and run as admin
- and write--> pacman -Ss gcc (in shell that opend after click)
- after clicking there will be bunch of things and now you have to care about your windows arch.. if it is 64 bit then write---> pacman -S mingw-w64-x86_64-gcc (and if its 32 you will find something like that where 64 will replaced by 32 in bunch of commands that are showing in your shell)
- after executing this command gcc will be installed in your system to check write: gcc --version || g++ --version
- After that to install the debugger write pacman -S mingw-w64-x86_64-gdb
- to check write: gdb --version
**Every thing got installed in your system now find the mingW file or mysys2 file on C drive(whereever you r mingW file got saved) go the the minGW 64 || 32 accroding to your operating system there is a bin folder click on that and copy the path inside the bin folder and save it in environment variables path **
Blockquote
Enjoy vs code
Works perfect in Visual Code. You need the following:
- C/C++ extension in Visual Code.
- msys64 installed in C:\
- Add path to msys64 bin folder in environment variable
Instructions:
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
Important the msys64 path doesn't contain spaces so don't install it in Program Files.
You can search "Edit system environment variables" from the windows button, press button Environment Variables, and then add it as a System variable "Path". For me its located in
CopyC:\msys64\mingw64\bin