3

I am a beginner in C++ as well as a beginning Netbeans user. How would I configure Netbeans to use C++11? I cannot seem to find the option anywhere.

mrQWERTY
  • 4,039
  • 13
  • 43
  • 91

3 Answers3

6

right click on your project -> Properties -> Build -> C++ Compiler -> Basic Options/C Standard -> C++11

Adding -std=c++11 compiler switch is also possible there, under Compilation Line -> Additional Options.

Note that you need appropriately new NetBeans version to have C++11 support.

Further reading:

Setting Default NetBeans Options (-std=c99, -Wall) for C programs

NetBeans settings for GCC

Community
  • 1
  • 1
  • This did the trick. Since C++98 was the default, do you know how I can set C++11 as the default for all future projects? – mrQWERTY Jul 06 '14 at 01:38
  • http://stackoverflow.com/questions/7882981/setting-default-netbeans-options-std-c99-wall http://stackoverflow.com/questions/4114042/netbeans-settings-for-gcc/11643274 –  Jul 06 '14 at 01:46
  • Haha, those answers seem really improvised. Anyways, I heard jetbrains is rolling out a C++ ide,so maybe that is more polished than netbeans. – mrQWERTY Jul 06 '14 at 02:45
1

regardless of IDE you setup this by specifying a compiler option.

for example if you use gcc compiler you would set a compiler option like so: g++ -std=c++11

and of course add other options you want.

see this duplicate

Community
  • 1
  • 1
codekiddy
  • 5,897
  • 9
  • 50
  • 80
1

Right click Project->Properties->Buld->C++ Compiler->Basic Options->C++ Standard

Note that using C++11 won't work though unless you have G++ 4.7 or later, which is not on a debian package yet. So, you can either build the newest version of G++ (4.7.4) or set the compilation line->Addition options to "-std=c++0x", which is the same as the C++11 according to this post:

function is not an element of std

Community
  • 1
  • 1
DeadTomGC
  • 101
  • 4