0

我正在尝试在 Netbeans 7.3 中设置 C++11,但是我似乎碰壁了。我得到的错误与标题相同:

cc1plus.exe: error: unrecognized command line option '-std=c++11'

我已经安装了 G++ 4.7.1(它应该支持 C++11)并在此处遵循该线程的说明:

为什么 Netbeans 不能识别 `cbegin()`、`cend()`、`unordered_set` 以及其他 C++ 功能?

这是控制台转储:

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
rm -f -r build/Debug
rm -f dist/Debug/MinGW_11-Windows/heap.exe
make.exe[1]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'


CLEAN SUCCESSFUL (total time: 654ms)

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_11-Windows/heap.exe
make.exe[2]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
mkdir -p build/Debug/MinGW_11-Windows
rm -f build/Debug/MinGW_11-Windows/main.o.d
g++    -c -g -std=c++11 -MMD -MP -MF build/Debug/MinGW_11-Windows/main.o.d -o build/Debug/MinGW_11-Windows/main.o main.cpp
cc1plus.exe: error: unrecognized command line option '-std=c++11'
make.exe[2]: *** [build/Debug/MinGW_11-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
make.exe": *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 1s)

顺便说一句,我在 Windows 上运行 Netbeans。

4

1 回答 1

0

更改-std=c++11-std=c++0x

于 2015-11-30T14:28:57.860 回答