Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ compiler error in netbeans

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.
like image 341
Babiker Avatar asked May 12 '09 20:05

Babiker


People also ask

How can I see errors in NetBeans?

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.

How install NetBeans C C++?

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!


1 Answers

The cause of the error is that Netbeans is incompatible with MinGW's make.

You have a choice of supported make versions:

  • Cygwin's make. Cygwin is a blessing. It brings as much Unix to Windows as you'd like.
  • MinGW's own MSYS, which "is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present". It is also a much smaller download than Cygwin.
like image 193
akamch Avatar answered Oct 04 '22 01:10

akamch