1

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".)

Edit: I have changed the string to

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

but have the same problem. I agree with the comment that this just doesn't appear to be modifying my build commands at all. When I compile, it outputs:

jGRASP exec: g++ -g -o gift1.exe gift1.cpp
David Lerner
  • 344
  • 3
  • 14

0 Answers0