I built and installed gcc-4.7 on Fedora 16 from source. But when i go to the installation directory (/opt/gcc-4.7.0/bin) and query for the version g++ -v
, i get gcc version 4.6.3 ...
. I did not use any suffix like -4.7
during the configuration, so my installed binary is g++
. Is there any other configuration required post installation?
Asked
Active
Viewed 594 times
0

badmaash
- 4,775
- 7
- 46
- 61
-
`./g++ -v` for security reasons the `PATH` does not include the current working directory. – Steve-o Sep 28 '12 at 17:50
1 Answers
0
Did you check the path?
which gcc /usr/bin/gcc
To change it to /opt/gcc... you can either set the PATH variable:
export PATH=/opt/gcc-4.7.0/bin:$PATH
..or create an alias, or set the CC and CXX variable to point to you gcc and g++ and then any ./configure / cmake / jam / etc should get the gcc declared in CC/CXX.

Gianni
- 4,300
- 18
- 24