Nikhil
Nikhil

Reputation: 121

GCC version is 4.8 still getting the error of unrecognized command -std=c++11 in centos

I am installing deepdetect. while compiling it is giving the error of

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

I have gcc version 4.8. Output of "gcc --version":

[root@datanode2 lib]# gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)

I have installed below package by yum:

devtoolset-2-gcc.x86_64 4.8.2-15.1.el6 @slc6-devtoolset

Output of "yum info gcc":

Installed Packages
Name : gcc
Arch : x86_64
Version : 4.4.7
Release : 18.el6
Size : 19 M
Repo : installed
From repo : base
Summary : Various compilers (C, C++, Objective-C, Java, ...)
URL : http://gcc.gnu.org
License : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
Description : The gcc package contains the GNU Compiler Collection version 
4.4.
: You'll need this package in order to compile C code.

Can anyone help me why I am getting this error. Default gcc package was gcc 4.4.7. After that I installed gcc 4.8.2 then also I am getting this error..

Any help would be appreciated.

Upvotes: 1

Views: 2011

Answers (1)

Florian Weimer
Florian Weimer

Reputation: 33717

The RPM package with the C++ compiler is actually called devtoolset-2-gcc-c++. It suspect the failed comment uses g++, not gcc, so it picks up the system compiler.

(By the way, you should really use a more recent version of DTS. C++11 support in GCC 4.8 is still experimental.)

Upvotes: 1

Related Questions