mercredi 26 août 2015

nullptr unrecognized with gcc 4.8

On a Red Hat Linux station, I use the devtoolset2 giving the following command:

scl enable devtoolset-2 bash

Then, when I call gcc --version, I get :

gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15) Copyright (C) 2013 Free Software Foundation, Inc.

But if I compile my program (malkefile generated with cmake, adding the line :

if(UNIX)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
endif()

I have the following error message :

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

And if I compile replacing -std=c++11 by -std=c++0x then, I obtain these messages :

nullptr wasnt declared in this scope.

How nullptr cannot be recognized considering it is a keyword ?

I don't understand, if you have any idea...

Aucun commentaire:

Enregistrer un commentaire