LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Suse 9.3 gcc-g++ Installation Problem (https://www.linuxquestions.org/questions/linux-newbie-8/suse-9-3-gcc-g-installation-problem-368318/)

limneos 09-29-2005 10:28 PM

Suse 9.3 gcc-g++ Installation Problem
 
Hello...
I have recently installed Suse 9,3 and one application needs g++ 3.4 in order to work.
The Suse 9.3 distribution comes with gcc-g++ 3.3.5.5 and version 3.4 is NOT avaiable, either on the installation CDs or the online update through Yast.
Therefore , I had to forget the convenient way of RPMs and look for the packages elsewhere.
I finally found the packages:

gcc-3.4.1.tar.gz
and
gcc-g++-3.4.1.tar.gz

I sucessfully compiled and installed the first , gcc-3.4.1.tar.gz.

My problem is with the second , the g++.
When I "tar -zxvf" the archive, I get two folders, libstdc++-v3 and gcc...
in folder gcc is another folder,"cp" with .h files.
in folder libstdc++-v3 is a "configure" file, but when I run it, it exits with an error:

"Cannot find install-sh in ./../.."
So I guessed I had to move the folders into the previous installation of gcc.
when I run configure now, I get another "cannot find file" error...
So I guess I'm doing something wrong generally....

What is the proper way to install gcc 3.4? and g++ ?
Is it so hard to be done?

Thank you all in advance for your help.

foo_bar_foo 09-29-2005 11:13 PM

i don't know for sure but possibly you have slackware packages there
use a package from here
ftp://mirrors.laffeycomputer.com/pub.../gcc/releases/

please never install a non-distribution compiler --prefix=usr over your other original one
everything will get borked
gcc versions are not reverse compatable

to get g++ just use
--enable-languages=c,c++

generally unless you know what you are doing compiling a new compiler with an older version is a little tricky and you could end up with junk from both mixed together

i hesitate to put this because i am not 100% sure but i think for that version you should use this
i say put it in /opt/gcc-3.4 to be safe
start off in the package directory after you untar it then
Code:

mkdir ../gcc-build
cd ../gcc-build
../gcc-3.4.0/configure --prefix=/opt/gcc-3.4  --enable-shared --enable-threads=posix --enable-__cxa_atexit  --enable-languages=c,c++

(i'm not sure about --enable-__cxa_atexit i know it works for 3.4.1 if it doesn't recognize the flag leave it out)
then and this bootstap switch is important
Code:

make bootstrap
make install

after you are done you will have to add the lib path /opt/gcc-3.4/lib to /etc/ld.so.conf and as root run
ldconfig

praveenr 09-30-2005 02:03 AM

hi,

first you download the gcc-3.4.1.tar.gz properly,then use this cmd
gunzip gcc-3.4.1.tar.gz
then tar -xvf gcc-3.4.1.tar then u get a directory there u search for make or install.sh or setup and install it,

regards
praveenr

limneos 09-30-2005 08:53 AM

Hello again..

foo_bar_foo, I did exactly what you wrote and the installation finished without any errors.

I also added the line in ld.so.conf and ran ldconfig as root, no errors either.
But when I try to run the program , it still says that I need 3.4 or later...
I checked the folder /opt/gcc-3.4.1 and exists properly with all the folders inside.

Is there something I must do to make the system "See" the new gcc? should I remove the old gcc 3.3.5.5 from Yast?
what is the safe procedure to do this and let the system see the newly installed gcc?

Thank you all for your help,

Limneos

AwesomeMachine 09-30-2005 06:27 PM

You do not want to replace these packages with the latest versions. You want to goto:

Control Center>yast2 modules>software>change source of installation

Give an ftp source like

mirrors.kernel.org

/suse/i386/9.3

anonymous

and make this the only active source

Then:

Finish

Then:

Install and remove software

Wait

select:

Package groups

go all the way to the bottom

select the last item:

All

scroll to the g's

on the packages you want to update, or install:

right click on the package name

select what you want to do

Do this for every package you want to update or install.

Do not use compiler versions that are not designed for SuSE 9.3

That is one package you should let SuSE update. It is a very critical package


All times are GMT -5. The time now is 05:00 AM.