C++ Error 'nullptr was not declared in this scope' in Eclipse IDE

后端 未结 7 599
借酒劲吻你
借酒劲吻你 2021-01-30 02:56

I am running Eclipse Helios and I have g++-4.6 installed. Hope I am not wrong that g++4.6 implements C++ 11 features. I have created a C++ project which uses the nullptr and aut

7条回答
  •  礼貌的吻别
    2021-01-30 03:37

    According to the GCC page for C++11:

    To enable C++0x support, add the command-line parameter -std=c++0x to your g++ command line. Or, to enable GNU extensions in addition to C++0x extensions, add -std=gnu++0x to your g++ command line. GCC 4.7 and later support -std=c++11 and -std=gnu++11 as well.

    Did you compile with -std=gnu++0x ?

提交回复
热议问题