I am running CentOS 6.6 x64 with Eclipse Luna and g++ 4.7.2 (provided by 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. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Unfortunately, when compiling, Eclipse is throwing errors saying "-std=c++11" isn't a valid option. I've set the dialect under the project properties >> C/C++ Build >> Settings >> Dialect >> "Other dialect flags" with the value "-std=c++11".
Invoking: GCC C++ Compiler make: *** Waiting for unfinished jobs.... g++ -std=c++11 .... cc1plus: error: unrecognized command line option "-std=c++11"
I've tried using the "Language Standard" option with "-std=c++0x", but it throws errors when compiling
map<int, MyObject*> myObjectMap;
// assume I've added in objects before the loop
for (const auto& kv : myObjectMap) // line 249
{
// do things
}
249: error: expected initializer before ‘:’ token
Aucun commentaire:
Enregistrer un commentaire