Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to compiling a program (via Make) using g++ 4.6.1 with flag -std=c++11. It's giving me:

cc1plus: error: unrecognized command line option ‘-std=c++11’

This is running on Ubuntu 11.04 Natty. (the same program compiles smoothly on Mac OS)

Here's my g++:

Using built-in specs.
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.6.0-3~ppa1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.1 20110409 (prerelease) (Ubuntu 4.6.0-3~ppa1) 
share|improve this question

closed as off-topic by Florian Diesch, Braiam, guntbert, Eric Carvalho, Alvar Dec 24 '13 at 1:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

I bet that in 12.04 that doesn't happen. – Braiam Dec 23 '13 at 17:53

Your program might be able to compile when compiled with the flag set to -std=c++0x, which was the other name for C++11 before the standard was released.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.