Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.6.1/lto-wrapper
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
add comment

1 Answer 1

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
add comment

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