C++11 Geany setup

mcd picture mcd · Jan 27, 2013 · Viewed 13.9k times · Source

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?

Answer

unsym picture unsym · Jan 28, 2013

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"