2

I set up NetBeans 8.1 on Linux Mint to compile C/C++. Everything went fine at first, until I tried using C++14.

I changed the settings for C++ from C++98 to C++11. There was an error in the program which I fixed. I got distracted and changed the settings again to use C++14. g++, or at least the version I have installed, does not support C++14, so I changed it back to C++11, but it's still using C++14 of its own accord. I tried changing it to C++11 and back again, and then to C++11 again. C++11 works for sure, because I've used that tag with success in the past.

Here is the build log:

cd '/home/.../NetBeansProjects/Sun Storm' /usr/bin/make -f Makefile CONF=Debug "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: Entering directory `/home/.../NetBeansProjects/Sun Storm' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/sun_storm make[2]: Entering directory `/home/.../NetBeansProjects/Sun Storm' mkdir -p build/Debug/GNU-Linux rm -f "build/Debug/GNU-Linux/main.o.d" g++ -c -g -std=c++14 -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.cpp g++: error: unrecognized command line option ‘-std=c++14’ make[2]: *** [build/Debug/GNU-Linux/main.o] Error 1 make[2]: Leaving directory `/home/.../NetBeansProjects/Sun Storm' make[1]: *** [.build-conf] Error 2 make[1]: Leaving directory `/home/.../NetBeansProjects/Sun Storm' make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 76ms) 

By seeing g++ -c -g -std=c++14, it is safe to assume that NetBeans is still using C++14, even though it is set to use C++11. How can I get NetBeans to use the settings that are actually there instead of making them up on its own?

Note: I couldn't find anything on the Internet about NetBeans not following the given settings.

I also tried deactivating the C/C++ plugin, restarting the IDE, and then activating it again. I also tried installing the GNU Standard C++ Library v3. Nothing changed.

1 Answer 1

1

Have you tried to change your "g++" call to devtoolset-2 ?

File->Project Properties -> Build -> Tools Colection->

Click in Version and you will see with compilers Netbeans is using

++++++++++++++++++++++++++++++++++++++++++++++++++++

C Compiler: gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)

C++ Compiler: g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)

Fortran Compiler: Tool not found

Assembler: GNU assembler version 2.20.51.0.2-5.44.el6 20100205

Make Tool: GNU Make 3.81

Debugger: Tool not found

QMake Tool: Tool not found

CMake Tool: Tool not found

++++++++++++++++++++++++++++++++++++++++++++++++++++

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for responding! I did not see any Tools Collection under Build. It did lead me to fixing, though. Thanks.