Unrecognized command line option “-std=c++11” c++ in Netbeans 7.2

爷,独闯天下 提交于 2019-12-22 05:18:35

问题


I am trying to use C++11. After sifting through the internet I found that all I have to do is right click on my project -> properties and under the "C++ standard" select c++ 11. When I run the program with C++ 11, I get this error "unrecognized command line option -std=c++11. One solution people have said is to add -g -std=c++0x in the "Additional Options" but then I get "unrecognized command line option -std=c++0x. I have downloaded gcc-4.7.1.tar.gz but I have no idea what to do with it.

Does anyone know how to get rid of this error or know how to make net beans compile with c++11?


回答1:


bump your gcc version to 4.7+. c++0x is supported since gcc4.3 while c++11 is supported since gcc4.7




回答2:


Steps to configure through Netbeans IDE:

  1. Right click on project and goto properties
  2. Go to Build -> C++Compiler
  3. In right hand side panel there are few options go to Basic options -> C++ Standard change its value from C++ 11 to C++ 98


来源:https://stackoverflow.com/questions/12377358/unrecognized-command-line-option-std-c11-c-in-netbeans-7-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!