c++ - Eclipse / g++ not recognizing "-std=c++11" flag -


i running centos 6.6 x64 eclipse luna , g++ 4.7.2 (provided devtoolset-2). i'm using eclipse's built in automatic makefile generation.

i've enabled g++ 4.7.2 using scl enable devtoolset-2 bash

[me@dev ~]# g++ --version g++ (gcc) 4.7.2 20121015 (red hat 4.7.2-5) copyright (c) 2012 free software foundation, inc. free software; see source copying conditions. there no warranty; not merchantability or fitness particular purpose.

unfortunately, when compiling, eclipse throwing errors saying "-std=c++11" isn't valid option. i've set dialect under project properties >> c/c++ build >> settings >> dialect >> "other dialect flags" value "-std=c++11".

invoking: gcc c++ compiler make: *** waiting unfinished jobs.... g++ -std=c++11 .... cc1plus: error: unrecognized command line option "-std=c++11"

i've tried using "language standard" option "-std=c++0x", throws errors when compiling

map<int, myobject*> myobjectmap;  // assume i've added in objects before loop (const auto& kv : myobjectmap) // line 249 {     // things } 

249: error: expected initializer before ‘:’ token

if want eclipse work installed devtoolset-2, need start eclipse environment has devtoolset enabled. can done terminal with

scl enable devtoolset-2 eclipse & 

to explain: devtoolset installed alternative development environment not active default. when explicitly activated, new compiler version understands -std=c++11 , features looking for.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -