Results 1 to 4 of 4
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 ...
- 12-07-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 3
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.
- 12-07-2010 #2
is the directory that g++ is installed to on path?
where did you install g++? what is value of PATH variable? were you in the correct directory when you created a link to g++?
- 12-08-2010 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 3
I installed in "/opt/gcc33/" ( --perfix=/opt/gcc33). I made a file "gcc34.sh" (as given in "Installing Alternate GCC Compiler on Fedora" mjmwiredDOTnet/resources/mjm-fedora-gccDOThtml) and export PATH as:
#!/bin/sh
GCC33_BIN=/opt/gcc33/bin
PATH=$GCC33_BIN:$PATH
export PATH
When I created the link, I was in "/usr/bin" directory.
Please let me know, if there is any mistake. Thank you.
- 12-08-2010 #4
you made a file called gcc34.sh with those contents?
all that file does is set a path, so you would need to execute it before having your path set
the easiest way to add an item to your path variable is to edit your ~/.bashrc file or ~/.bash_profile and put those 3 lines in it, otherwise every time you log in you will need to execute that other file you are talking about


Reply With Quote
