我已经搜索谷歌的解决方案来解决这个问题(包括c ++ 11上的几个帖子功能不起作用),我找不到解决方案。在过去的一年里,我越来越依赖netbeans,将它用于我所有的计算机科学课程。但是在我的IDE中,C ++的某些功能受到限制有点麻烦,特别是当它们是我教授用来教C ++的功能时。当我以任何方式使用stoi()
时,我收到"Unable to resolve identifier"
错误。是否有一些热门方法可以让netbeans获得这些功能?
我已经为我的第一次编程工作而努力了,但是因为我刚刚学习C ++,所以我现在想跟随我教授的领导而不做任何无关紧要的工作。
我在此处尝试了已接受的解决方案:How to use C++11 std::stoi with gcc?,此处:Netbeans C/C++ 7.2 -std=C++11 not recognized by gcc v4.6 or lower我仍然遇到错误。就像免责声明一样,据我所知,我正在使用此处涉及的列出的包含。所以,如果有人有解决方案,我会非常感激。
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Zachary/Documents/NetBeansProjects/CS_240_HW01'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/cs_240_hw01.exe
make[2]: Entering directory '/cygdrive/c/Users/Zachary/Documents/NetBeansProjects/CS_240_HW01'
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f "build/Debug/Cygwin_4.x-Windows/main.o.d"
g++ -std=c++0x -c -g -std=c++11 -MMD -MP -MF "build/Debug/Cygwin_4.x-Windows/main.o.d" -o build/Debug/Cygwin_4.x-Windows/main.o main.cpp
main.cpp: In function 'int main(int, char**)':
main.cpp:24:26: error: 'stoi' was not declared in this scope
int myint = stoi(test);
^
nbproject/Makefile-Debug.mk:84: recipe for target 'build/Debug/Cygwin_4.x-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin_4.x-Windows/main.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Zachary/Documents/NetBeansProjects/CS_240_HW01'
nbproject/Makefile-Debug.mk:62: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Zachary/Documents/NetBeansProjects/CS_240_HW01'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
EDIT: Added Build output