PDA

View Full Version : specify verison of g++



abraxas334
June 4th, 2008, 12:10 PM
Heya,
I was wondering if there is a way to specify which version of g++ i use for compiling. I have the latest one installed but would like to use an older version. Is that somehow possible?
Antonia

lixx
June 4th, 2008, 12:42 PM
Heya,
I was wondering if there is a way to specify which version of g++ i use for compiling. I have the latest one installed but would like to use an older version. Is that somehow possible?
Antonia

a 'hackish' solution would be is to change symlinks.
in my system, /usr/bin/g++ is a symlink which points to
/usr/bin/g++-4.2.
so if i were to change that to an older version,
i would simply issue this command:

sudo ln -sf /usr/bin/g++-3.4 /usr/bin/g++
--> assuming i have version 3.4.

abraxas334
June 4th, 2008, 01:36 PM
Thanks lixx that worked well for me :)

geirha
June 4th, 2008, 03:40 PM
The better way is to set the environment variable CXX to the desired g++ version. Any sane makefile will read this variable. I.e.



export CXX=g++-3.4
./configure
make