C++ 11 Geany设置

mcd*_*mcd 8 c++ gcc geany c++11

我正在学习C++,我需要在Geany for C++ 11中正确设置我的编译和构建命令.

我以为我让它们正确,但在使用时auto,我收到以下错误:

warning: ‘auto’ will change meaning in C++0x; please remove it [-Wc++0x-compat]
Run Code Online (Sandbox Code Playgroud)

这是我当前的set build命令:

Compile:  g++ -Wall -c "%f"
Build:  g++ -Wall -o "%e" "%f"
Execute:  "./%e"
Run Code Online (Sandbox Code Playgroud)

为了正确编译,构建和执行C++ 11程序,我需要将它们设置为什么?

uns*_*sym 9

正如评论中指出的那样,您需要添加标志-std=c++0x.您可以在"Build" - >"Set build commands"中设置它,然后在以下框中修改命令:

编译:

g++ -Wall -std=c++0x -c "%f"
Run Code Online (Sandbox Code Playgroud)

建立:

g++ -Wall -std=c++0x -o "%e" "%f"
Run Code Online (Sandbox Code Playgroud)