LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 09-10-2007, 02:25 AM   #1
lali.p
Member
 
Registered: Jan 2007
Distribution: Slackware 11.0
Posts: 141

Rep: Reputation: 16
How to upgrade to gcc 4.1.2 from gcc 3.4.4 on Slackware 11.0


Hi,
Sorry for a long post.
I downloaded the packages form a mirror site (university of utah)and used upgradepkg script to upgrade my gcc3.4,g++,gcc-gnat,gcc-fortran,gcc-java and gdb to the latest versions available as Salckware packages.

However when i try to compile any c++ file using g++ it shows a list of errors (errors by assembler and i don't know what it means)
each error shows --->weakref(i can't understand what that means)

I can't post those errors as i am in office and Salcware is at home(and i dont have internet access at home)

So i have the following questions:

1)Is my procedure right ? May be i neeed to upgrade some other packagges as well and the problem could be solved.(my previous 3.4 gcc works perfectly fine.

2)I have deep interest in programming in Linux.I am intermediate C++ programmer and uptil now i've programmed only on Microsoft VS2005 IDE.

3)I however,want to develop strict ANSI/ISO C++ standard programs.
I guess it can be done using -ansi -pedantic -Wall options ?????
Can you throw some light on that.I mean a complete tutorial.I have already read the man page but could not understand -Wall option.
Some one suggested to use -ansi -pedantic-errors -Wall $1 $2 $3 option.
now what does $ mean ??

4)As a student i want the complete set of tools provided by GNU/gcc that can be used to develop a professional software and my favourite language is C++.I plan to read details of how Linux kernel works(i guess that would require a lot of C and assembly) as i want to know the ins and outs of an OS.Can some 1 tell how to start ?
i would really appreciate help.
 
Old 09-10-2007, 04:07 AM   #2
ghostdancer
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 266

Rep: Reputation: 30
Slack12 is based on newer glibc than Slack11. I don't think you can just upgrade a package from Slack12 to Slack11 like that. I suggest you should upgrade the entire Slack11 to Slack12.
 
Old 09-10-2007, 05:04 AM   #3
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
you should rather try downloading the gcc-4.2 source and try upgrading that.

I still don't think you should do this. If you really really want to try gcc-3 , install gcc using something like ./configure --prefix=/opt/gcc-4
 
Old 09-10-2007, 06:10 AM   #4
lali.p
Member
 
Registered: Jan 2007
Distribution: Slackware 11.0
Posts: 141

Original Poster
Rep: Reputation: 16
I have googled and found out that gcc and glibc are interlinked.
and in order to upgrade gcc i must upgrade glibc and upgrading glibc is quite pain in the ass as it can break my system.


So long story short i should go for Slackware 12 right ???
 
Old 09-10-2007, 06:31 AM   #5
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Repeat after me: do not mess with the system toolchain.

Upgrading to Slack12 will give you gcc 4.1.2, linked against glibc 2.5 . Off the top of my head I don't know what the requirements to build gcc 4.x.x are, but it is usually possible (if you didn't want to upgrade to 12, for whatever reason) to build another compiler with the libs you already have provided there isn't too much difference between them, as duryodhan mentioned. 3.3.6 -> 4.x.x is doable; 2.95.0 -> 4.x.x is probably not =)

Take a look at the slackbuild script for gcc (the one script generates all the gcc packages) if you want to look at building your own without rebuilding the whole system. For your convenience, here's a link straight to the directory where it's located (through my favourite mirror - adjust as necessary!):

http://ftp.heanet.ie/mirrors/ftp.sla..._source/d/gcc/

The only thing you should be aware of is that when calling a compiler that's installed in a non-standard (ie: outside of your path) place, you need to tweak your environment to ensure you're actually using the right compiler.

Good luck,
- Piete.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade from gcc 3.X to gcc 4.0 in Slackware Bob_H Linux - Software 2 06-01-2006 08:51 PM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare Suse/Novell 3 11-29-2004 02:13 PM
gcc Upgrade (RH 7.3) ejfuente Linux - Newbie 1 10-21-2003 09:37 AM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM
gcc upgrade tundra Linux - General 10 09-08-2002 03:11 AM


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

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