I'm trying to make a simple "Hello World!" program in NetBeans IDE 7.3 with MinGW as my C++ compiler.
I'm getting build failures and I'm at a loss as to understanding why.
This is my compiler setup:
- Family: MinGW
- Base Directory: C:\MinGW
- C Compiler: C:\MinGW\bin\gcc.exe
- C++ Compiler: C:\MinGW\bin\g++.exe
- Assembler: C:\MinGW\bin\as.exe
- Make Command: C:\MinGW\msys\1.0\bin\make.exe
- Debugger Command: C:\MinGW\bin\gdb.exe
I've made sure to that my environment PATH directs to C:\MinGW\bin and C:\MinGW\msys\1.0\bin.
My code is:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
After trying to build the project, I recieve this message from the NetBeans debug output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/NetBeansProjects/HelloWorld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/helloworld.exe
make[2]: Entering directory `/c/NetBeansProjects/HelloWorld'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++ -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
make[2]: g++: Command not found
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make[2]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I've search various Q&A, but I seem to be doing everything correctly.
C:\MinGW\bin\g++.exe
exist? - Keith Thompsong++
and friends. Or, if you changed yourPATH
recently, perhaps NetBeans doesn't have your updatedPATH
; in that case, shutting down and restarting NetBeans might fix it. - Keith Thompsonmake
in your setup isC:\MinGW\msys\1.0\bin\make.exe
, but the log shows that/usr/bin/make
is being used; your setup indicates that the C++ compiler isC:\MinGW\bin\g++.exe
, butg++
is being invoked (with no path). There's a major disconnect between your compiler setup and how the project is trying to build. - Michael Burr