问题
I am learning C++ and I need to properly setup my compile and build commands in Geany for C++11.
I thought I had them correct, but when using auto
, I receive the following error:
warning: ‘auto’ will change meaning in C++0x; please remove it [-Wc++0x-compat]
Here are my current set build commands:
Compile: g++ -Wall -c "%f"
Build: g++ -Wall -o "%e" "%f"
Execute: "./%e"
What do I need to set these to in order to properly compile, build, and execute a C++11 program?
回答1:
As what is pointed out in the comments, you need to add the flag -std=c++0x
. You can set it in the "Build" -> "Set build commands", then modify the commands in following boxs:
Compile:
g++ -Wall -std=c++0x -c "%f"
Build:
g++ -Wall -std=c++0x -o "%e" "%f"
来源:https://stackoverflow.com/questions/14544325/c11-geany-setup