LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-06-2008, 07:45 PM   #1
David570
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Rep: Reputation: 0
Co-existing gcc


I would like to know if anyone can tell me how I can co-exist gcc-4.x.x with gcc-3.x.x I have software I use (paid for!). which was compiled under
gcc-3.2.3. It will NOT compile on any thing over that version. So
since I have upgraded to Slackware 12.1 (GREAT!) I need to have gcc-3.x.x co-exist with gcc-4.x.x. Help!!
 
Old 09-07-2008, 01:16 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,292

Rep: Reputation: 65
compile each with different prefixes.
configure --prefix=/usr/local/gcc-3.x.x
 
Old 09-07-2008, 10:40 AM   #3
David570
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Co-exist

Well yes , i could but gcc-4.x.x is the resident compiler and when i try
to compile backwards (gcc-3.x.x) it barfs bad and crashes. I guess I could
use slackpkg remove 4 and install three then rebuild 4......??? Do u think that would work ??? I guess i'll give it a try.... Thanks for the reply.
 
Old 09-07-2008, 12:17 PM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,811
Blog Entries: 58

Rep: Reputation: Disabled
Try this package, it's for 12.0, but it might do:
http://www.slackware.com/~alien/slackbuilds/gcc34/
 
Old 09-07-2008, 06:45 PM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,292

Rep: Reputation: 65
I've got all these in one directory, /usr/gcc/, and I use a script to change between them when I want to.
0 gcc-2.95.3 0 gcc-3.2.3 0 gcc-3.4.4
0 gcc-3.0.4 0 gcc-3.3.6 0 gcc-4.0.0

When I compiled and installed each, I renamed the gcc, cc, c++, g++, files to gcc-3.3.6, cc-3.3.6, c++-3.3.6, etc ..., in the /usr/bin directory. I have a script for each version that makes symlinks from the version I am switching to, to the proper names.


/usr/local/bin# cat gcc3.3.6
GCCOPTS="-O2 -Wall -march=i686 -fPIC"
export CC="/usr/gcc/gcc-3.3.6/bin/gcc $GCCOPTS"
export CXX="/usr/gcc/gcc-3.3.6/bin/g++ $GCCOPTS"
export CFLAGS=$GCCOPTS
export CXXFLAGS=$GCCOPTS
rm /usr/bin/gcc /usr/bin/g++ /usr/bin/c++
ln -s /usr/gcc/gcc-3.3.6/bin/gcc /usr/bin/gcc
ln -s /usr/gcc/gcc-3.3.6/bin/g++ /usr/bin/g++
ln -s /usr/gcc/gcc-3.3.6/bin/c++ /usr/bin/c++

I'm sure this is a sloppy way to do this, but it's been working for years, so I just left it.
 
Old 09-08-2008, 04:32 PM   #6
David570
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Co-Exist

Ok, guys thanks a heap. I'll try ur script. Anything to save my money.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
add an existing user to an existing group? tramni1980 Slackware 5 05-08-2008 08:28 PM
how to add existing files to existing imported kdevelop project?? santana Programming 1 05-22-2007 10:53 AM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 01:07 AM
Dual boot "merge" from existing 98 & existing Linux atsmith Linux - Newbie 4 07-13-2003 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration