Running devtool-set version of g++ from Makefile

Latest response

Good morning!

I just installed devtools-2 as I need better c++11 support in our project. Everything works fine, but I can't figure out how I use this version when compiling using a Makefile, as it then seems to fallback and using version 4.4

[idd@rh67bda scripts]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.9 (Santiago)
[idd@rh67bda ~]$ g++ -v
gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
[idd@rh67bda ~]$ scl enable devtoolset-2 'bash'
[idd@rh67bda ~]$ g++ -v
gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)
[idd@rh67bda scripts]$ make version
g++ -v
gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
[idd@rh67bda scripts]$

Running this doesn't seem to work either, as 4.8 understands c++11:

[idd@rh67bda scripts]$ scl enable devtoolset-2 'make'
cc1plus: error: unrecognized command line option "-std=c++11"

Maybe not a devtool issue per se, perhaps more a bash/make problem, but any help would be greatly appreciated

Regards
Richard

Responses