Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++11 Geany setup

Tags:

c++

gcc

c++11

geany

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?

like image 625
mcd Avatar asked Jan 27 '13 04:01

mcd


1 Answers

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"
like image 131
unsym Avatar answered Oct 07 '22 06:10

unsym