While you obviously successfully compile the code with gcc from within Eclipse, Eclipse has its own built-in C++ parser and you need to separately let it know that you are using C++11.
Add the -std=c++11
option to the CDT GCC Builtin Compiler Settings
under Project propierties -> C/C++ General -> Preprocessor Include Paths
, the compiler specs should look similar to this:
${COMMAND} -E -P -v -dD ${INPUTS} -std=c++11
UPDATE. Please read Setting Up Include Paths and Macros for C/C++ Indexer to understand how CDT automatic discovery of include paths and preprocessor symbols (aka Scanner Discovery) for supported tool chains is applicable to you.
The gist is that the CDT uses the Language Settings Providers
to find include paths and preprocessor symbols. And Language Settings Providers
can be configured on project properties page "Preprocessor Include Paths, Macros, etc."
Once you have proper settings you can make them a template workspace and just copy the template workspace over for your new projects, or alternatively have a script that will set up just the relevant settings. Also see: Setting preferences for all Eclipse workspaces.