mercredi 1 juillet 2015

Compile to c++11 in Jgrasp

I have Jgrasp set up and running fine with c++. I want to use c++11. I get the following compile error:

gift1.cpp:52:24: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11

Which I attempt to solve by clicking Settings, compiler settings, workspace. I copied my environment settings "g++ - generic" and renamed it "user: g++ - generic." I then clicked edit. I changed the original compile code:

g++ %<CY> %<D> -g %<D> -c -o %<RELE_DEF_BIN_DIR>%<base>.o %<> %<REL_FILE>

to

g++  %<CY> %<D> -g %<D> -c  -o -std=c++11 %<RELE_DEF_BIN_DIR>%<base>.o %<> %<REL_FILE>

But it still gives the same error. (I added "-std=c++11".)

Aucun commentaire:

Enregistrer un commentaire