Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-13-2005, 11:29 PM   #1
LQ Newbie
Registered: Sep 2004
Location: Canada
Distribution: Red Hat 9.0
Posts: 4

Rep: Reputation: 0
Problem with installation of gcc 3.4.3

hello there,

I need to upgrade my gcc from 3.2.7 to 3.4.3, I tried gcc-3.4.3-11.i386.rpm and gcc-3.4.3-13.i386.rpm, but it seemed that my system always lack of some packages, like libgcc, cpp, etc. I don't know what this is about, since I just started to use linux.

so what is the procedure for the upgrading of gcc, please help out!


Old 01-14-2005, 03:30 AM   #2
Junior Hacker
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
All you do from a console is type as root # urpmi gcc-3.4.3-13.i386.rpm when you use the urpmi command it will also install all the dependencies required to go with that gcc package, in other words those other items are needed for that version of gcc to function and/or documentation to put in the libraries. If you got the gcc-3.4.3-13.i386.rpm from the net & not off your CD'S then chances are you will have to also download those other items, put them all in the same directory such as /home/user with your gcc-3.4.3-13.i386rpm, user is your user name, make sure you are in that directory when you issue the urpmi command, Make sure the other items are (rpm's) also, get them from this site
just type the exact name of the item your distro said it needed & hit search, then select one that matches your distro and/or kernel. If you got your gcc rpm off your cd then the others should be there also, so when you type the urpmi command it will tell you to put the neccessary CD in the drive & will install.
for more info on the urpmi command type # man urpmi
from a console to get the lowdown on what it does.
Just a note: on my Mandrake 10.1 the documentation tells me that if I want to redo or upgrade or change the kernel, the prefered version of gcc utility to use is 2.95.x as this version is proven and higher versions are not as well tested/proven or something like that. From a console type # cd /usr/src/linux
then type # lynx . with the space & the (.) to signify the current directory, this will list all that is in the current directory, scroll down to documentation with arrow keys & hit the right arrow key to enter then scroll down to changes and hit the right arrow key then read it.

Last edited by Junior Hacker; 01-14-2005 at 04:10 AM.
Old 01-14-2005, 12:14 PM   #3
LQ Newbie
Registered: Sep 2004
Location: Canada
Distribution: Red Hat 9.0
Posts: 4

Original Poster
Rep: Reputation: 0
thanks a lot! actually I did exactly what you suggested, and the packages I had were also from but searching all packages over the internet was not as easy as i expected, some of them are not from the packages as their names suggest, that is why I thought that might have some shortcut.

by the way is there any combo of the whole package which only needs one "rpm -i" to get all job done?
Old 01-14-2005, 10:47 PM   #4
LQ Newbie
Registered: Sep 2004
Location: Canada
Distribution: Red Hat 9.0
Posts: 4

Original Poster
Rep: Reputation: 0
Still getting nowhere, always run into this hopeless dependency problem...

Now I have easily upgraded gcc 3.2.7 to gcc 3.3.2, but never made it to 3.4.x, and what is more, the dependency problem is like a dead lock, and the required packages are too many to list here.

So has anybody successfully done this thing with Red Hat 9.0?

Please, please help out!
Old 01-15-2005, 02:13 AM   #5
Registered: Sep 2004
Posts: 273

Rep: Reputation: 30
Well, since linux applications generally are not self-contained it can be a nightmare upgrading if you use plain RPM:s. One solution, and don't let that scare you, is to build GCC 3.4.3 from source. Doing so won't require the very latest version of the packages (binutils etc etc, see complete list at their site) even if the gcc-3.4.3-rpm does. Here are the steps I (and I stress I here, these steps might not be appropiate for your system) use when building GCC from source:
$ cd /path_to/gcc-3.4.3.tar.bz2
$ mkdir obj_gcc_3.4.3
$ bunzip2 gcc-3.4.3.tar.bz2
$ tar xvf gcc-3.4.3.tar
$ cd obj_gcc_3.4.3/
$ ../gcc-3.4.3/configure --enable-languages=c,c++ --prefix=/usr/local/gcc-3.4.3
$ make
$ make install
This will install gcc 3.4.3 to /usr/local/gcc-3.4.3 and that path won't conflict with anything else you have installed.
But in order to use it properly you must update your PATH. On my system I edit a file called /etc/profile and there I add
"/usr/local/gcc-3.4.3/bin:" (without the quotes) first to the PATH-statement. It needs to be first so it will find this version
of GCC before it finds any previously installed version. When you have finished editing the file perform this command so the changes goes "live":
$ source /path/to/filewithpath
When building C++ programs you need link to the C++ standard library. To do that,
add the following in your linking command:
This works on my system and it may work on yours. You might want to check out the other options available when configuring to see if anything's missing. One thing that may confuse some people is that you have separate source and build directories when building GCC. It's normal for GCC even though it may look odd to some.

Last edited by Hivemind; 01-15-2005 at 02:15 AM.
Old 01-16-2005, 11:03 AM   #6
LQ Newbie
Registered: Sep 2004
Location: Canada
Distribution: Red Hat 9.0
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you all very much!

This time it seemed working for me except for the source part, it doesn't matter much though.

But I still have this compilation problem, it seems that both gcc 3.4.3 and gcc 3.3.2 do not accept the following declaration:
friend GLUI_Rollout;
friend GLUI_Main;
etc, ...

unless you add class-key: 'struct', what's more, gcc 3.3.2 does not even accept the void return value from main function which doesn't make any sense to me.

So with this kind of compiler, I don't know how much you can trust your code.

Do I have to say GNU's gcc sucks?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 9.3 gcc-g++ Installation Problem limneos Linux - Newbie 4 09-30-2005 06:27 PM
GCC upgrading/installation problem mcrexx Linux - Newbie 5 09-17-2005 12:33 PM
GCC 2.95 nagging installation problem cutesneakers Linux - Software 2 04-13-2005 07:40 AM
Problem with gcc on USB driver installation Shaikoten Linux - Software 1 11-24-2003 11:29 PM
Gcc installation problem Agileuk Linux - Newbie 2 09-28-2003 06:11 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration