I've tried everything from reading the Netbeans help to browsing Google.
This code works fine in Dev-Cpp but not Netbeans 6.5.1. Netveans also places and exclamation mark next to #include <iostream>
which i checked and is in the include path of netbeans and is in the include folder:
#include <iostream>
int main() {
std::cout << "Test" << "\n";
return (0);
}
My build tools are set to:
Family: MinGW
Base Directory: C:\Dev-Cpp\bin
C Compiler: C:\Dev-Cpp\bin\gcc.exe
C++ Compiler: C:\Dev-Cpp\bin\g++.exe
Fortran Compiler: C:\Dev-Cpp\bin\g77.exe
Make Command: C:\Dev-Cpp\bin\make.exe
Debugger Command: C:\Dev-Cpp\bin\gdb.exe
I get error:
Running "C:\Dev-Cpp\bin\make.exe -f Makefile CONF=Debug" in C:\Documents and Settings\Babiker\Desktop\Temp\Test
! was unexpected at this time.
C:\Dev-Cpp\bin\make.exe: *** [.validate-impl] Error 255
Build failed. Exit value 2.
In NetBeans, if we click on an error message, the IDE will highlight that line of code: If we add in our semicolon, then our program builds successfully as shown in the following screenshot: That's all there is to it. Of course, not all error messages are quite that self-explanatory.
Click on Options under Tools menu, click on C/C++. Then, click on Add button in bottom-left corner of the window. Once "Add New Tool Collection" button appears, click on Browse, and select "C:\cygwin\bin" as the base directory and say OK. Now, we are all set to work on C/C++ programs using NetBeans IDE!
The cause of the error is that Netbeans is incompatible with MinGW's make.
You have a choice of supported make versions:
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