cc1plus: error: unrecognized command line option -std=c++11 with g++
Seeing from your G++ version, you need to update it badly. C++11 has only been available since G++ 4.3. The most recent version is 4.7.
In versions pre-G++ 4.7, you'll have to use -std=c++0x
, for more recent versions you can use -std=c++11
.
gcc 4.8.2 cc1plus: error: unrecognized command line option -std=gnu++11
I solved the problem.
The problem was the $PATH
variables for me and other users.
Now, other users have an alias for g++
to the newer version, but their $PATH
omits the actual location.
Make works based on their $PATH
variable, so to fix it, I just had to make sure their path had the same location as mine.
unrecognized command line option ‘-std=c++11’
GCC 4.6 series is rather old (2011-2012). It was first released when C++11 was still called C++0x, so it supports -std=c++0x
switch rather than std=c++11
. Its support of C++11 is rather incomplete, so more modern code which uses C++11 features heavily may or may not compile.
Getting the error cc1plus: error: unrecognized command line option -std=c++11 when I run code on Qt creator
Your 4.4.7 version of gcc is too old to fully enable C++11 features.
You need to upgrade the compiler to a version superior to 4.6 ( at least ) or if it's possible for you, upgrade your distro (let's say RHEL 7) which includes a more recent compiler.
cc1plus: error: unrecognized command line option -std=c++11
That flag was not added until a later version of g++
(4.7) to get the gcc 4.4 compat (as much as was there) you need to use the -std=c++0x
flag.
Ref: https://gcc.gnu.org/projects/cxx0x.html
cc1plus: error: unrecognized command line option -std=c++0x
According to this:
[rescape@iZ231twjza6Z mxnet]$ make
g++ ...
You not use CXX
variable in your Makefile, so just replace g++
with CXX
in your Makefile
. aliases works only when you enter commands in your shell, if you type g++ something.cpp
bash execute /home/bin/g++ something.cpp
, that's all, bash
aliasing not help if external process (in our case make) execute g++
Related Topics
Does Try-Catch Block Decrease Performance
Image Edge Smoothing with Opencv
How Do Memory_Order_Seq_Cst and Memory_Order_Acq_Rel Differ
C++ Format MACro/Inline Ostringstream
Which Is Faster: X<<1 or X<<10
Constructor Initialization VS Assignment
How to Find a Particular Value in an Array and Return Its Index
How to Test an Exe with Google Test
Clang C++ Cross Compiler - Generating Windows Executable from MAC Os X
Is 1.0 a Valid Output from Std::Generate_Canonical
Performance Wise, How Fast Are Bitwise Operators VS. Normal Modulus
What Does 'Return *This' Mean in C++
C++ Local Variable Destruction Order
How to Include the String Header
How to Cast Simple Pointer to a Multidimensional-Array of Fixed Size