Running devtool-set version of g++ from Makefile
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
Hi Richard,
I'm not sure why the DTS version of make isn't working for you. I just tried it on a fresh install, and it works with the scl commands you used. (Also, I'm unsure what the make version command means -- do you have a target named version in your Makefile?)
Anyway, is there any reason for you to use DTS 2? The current version of DTS is 6.1, which provides significantly newer versions of all components, including GCC and Make. DTS 6.1 is also compatible with RHEL 6.9, which you use, so you shouldn't have any problems installing it. See Installing Red Hat Developer Toolset in the DTS 6.1 User Guide.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
