I'm running MinGW on windows XP SP3. I wrote a simple program in C++ and saved it as a .cpp file. When I tried to compile it in MinGW at the correct directory a message appeared saying " Error: No such file or directory exists" but I know its in the correct directory.
This is what I typed into MinGW
cd C:\MinGW test # Where I saved the .cpp file
g++ test.cpp -o test.exe
After that an error appears.
Also I did change the Environment Settings path to C:\MinGW\bin
To get it to work, you should run the compiler from the folder where the program is, not where MinGW is. First, you need to set your PATH to include MinGW. You can do this with set PATH = C:\MinGW\bin;%PATH% on the command line.
Then, cd to where the program is located and run g++ test.cpp -o test.exe to compile, and test to run.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With