LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Creating link to newly installed g++ (https://www.linuxquestions.org/questions/linux-software-2/creating-link-to-newly-installed-g-848952/)

ritika_sharma 12-07-2010 08:24 PM

Creating link to newly installed g++
 
Hello,
I have installed gcc-3.3 & g++-3.3 in ubuntu 9.04. Now I want to change the default compiler as gcc-3.3/g++-3.3. After creating links to newly installed gcc/g++, gcc works fine but g++ doesn't work.
When I give "$which gcc" or "$gcc --version" it works fine, but when I give "$which g++" it gives nothing and also "$g++ --version" it gives an error "the program 'g++' can be found in the following packages: * g++..."
When I installed gcc I gave the command "$configure --perfix=/opt/gcc33 --program-suffix=33 --enable-languages=c,c++" .
When I give "$which g++33" and "$g++33 --version", work fine.

I tried following:
$export CXX=g++33
$sudo ln -s g++-3.3 g++
Nothing happens.
I am very new in Linux and I need to install ns2.1a9b in gcc-3.3. Please help me.

ozanbaba 12-08-2010 04:19 AM

you should create symbolic links to g++ in several places

First find every g++33 occurrence
Code:

$whereis g++33
after that add a symbolic link to ever g++ occurrence with ln -s

I'm guessing g++33 would be at least in /usr/bin

and here's a example
Code:

#Let's say whereis found g++33 in /usr/bin
$sudo ln -s /usr/bin/g++33 /usr/bin/g++

go and ln -s ever occurrence of g++33 similar to the example and you will be fine.

knudfl 12-08-2010 08:57 AM

The usual solution to have gcc / g++ version 3.3 on Ubuntu 9.10 is :
Use the packages from Ubuntu 8.04 Hardy. ( It's version 3.3.6 ).


Using gcc-3.3 and g++-3.3 in ns-2.1b9/
Edit the Makefile.in , line 36 - 37 to
CC = gcc-3.3
CPP = g++-3.3
( Please replace with your file names. gcc33 ? g++33 ? ).

But I am not sure, you can compile ns-2.1b9 with g++ 3.3.
Will usually require gcc / g++ version 3.2 , only found on CentOS 3.9 .
..


All times are GMT -5. The time now is 07:44 AM.