LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem with installation of gcc 3.4.3 (https://www.linuxquestions.org/questions/programming-9/problem-with-installation-of-gcc-3-4-3-a-277586/)

lxeye 01-13-2005 11:29 PM

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, libc.so.6 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!

thanks!

Eye

Junior Hacker 01-14-2005 03:30 AM

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
http://rpm.pbone.net/
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.

lxeye 01-14-2005 12:14 PM

thanks a lot! actually I did exactly what you suggested, and the packages I had were also from pbone.net. 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? :)

lxeye 01-14-2005 10:47 PM

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!

Hivemind 01-15-2005 02:13 AM

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:
Code:

$ 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":
Code:

$ 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:
Code:

-L/usr/local/gcc-3.4.3/lib/
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.

lxeye 01-16-2005 11:03 AM

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:
eg:
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?


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