Question

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.
Was it helpful?

Solution

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.

OTHER TIPS

MinGW make tool in not compatible with NetBeans. Use msys make tool instead.

When you choose to use the make tool from msys, please be carefull to be installed in a path without spaces.

For example C:\Program Files\MinGW\msys\1.0\bin\make will fail. A good choice would be C:\MinGW\msys\1.0\bin\make.

i suggest you to use codeblocks compiler for netbeans i hope this will help you

there is only a easy method to configure netBeans is first you download and install Code::Blocks IDE from Code::Blocks IDE Downlowd and MSYS 1.0.11

all setting will automatically configured

but one thing you have to

select is make command

from

C:\msys\1.0\bin\make.exe enter image description here

i hope this help for you

This may be irrelevant but you do have your make environment associated with the correct filetypes? So it's not trying to compile a .cpp file with the normal c-compiler or anything like that? I've never used your environment, but something like that is always possible I'd think.

And on that note, your code is IN a .cpp file, and not a .c file? Or maybe you have it in a .cxx file (I've seen that before for C++, rare, but I've seen it), and .cxx isn't associated with C++, so it "defaults" to C for unknown types?

Maybe seeing your makefile will also help offer some insight.

I tried running this code in netbeans 6.5 and it worked fine. I do not understand from the question how exclamation mark was added.

I suggest checking the linker options to ensure that netbeans is linking correctly to C++ standard library.

You can find this option by right click on project file -> properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top