LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-16-2007, 12:52 PM   #1
hydrogeek
LQ Newbie
 
Registered: Nov 2007
Location: Cambridge, MA
Distribution: Fedora
Posts: 4

Rep: Reputation: 0
include path for multiple versions of gcc


I am trying to compile some C++ code using gcc version 2.95.2 on my FC6 system. I didn't want to disturb the compiler already on here (4.1.2), so I build the older version from source into another location using the --prefix (essentially following the instructions at http://www.tellurian.com.au/whitepapers/multiplegcc.php.

Upon compiling, gcc now can't seem to find its include libraries (no such file or directory for things like iostream). I am using -v to verify that the compiler being run is indeed version 2.95.2, and have tried accomplishing that both by changing the make file and by adding the path-changing wrapper Gnashley describes in http://www.linuxquestions.org/questi...of-gcc-594814/
I've tried linking explicitly to the libraries using -I. Does anybody know what I might be missing?

Thanks for helping me out!
 
Old 11-16-2007, 10:23 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
It might be better to use --program-suffix to alter the actual name of the compiler (i.e. --program-suffix=-2.95.2 to give you gcc-2.95.2, etc.) and install in the normal location.
ta0kira
 
Old 11-18-2007, 11:27 AM   #3
hydrogeek
LQ Newbie
 
Registered: Nov 2007
Location: Cambridge, MA
Distribution: Fedora
Posts: 4

Original Poster
Rep: Reputation: 0
--program-suffix doesn't build

Hmm...this is perhaps changing topics, but I can't seem to build gcc using the program-suffix option at all.

I tried to build using
Code:
/home/konings/software/gcc-2.95.2/configure --program-suffix=2.95.2
And then tried both make bootstrap and make followed by make install to actually build. In both cases, after a bunch of output, the last couple of lines of make are the following:
Code:
/home/konings/software/gcc-2.95.2/gcc/ch/decl.c: In function ‘start_struct’:
/home/konings/software/gcc-2.95.2/gcc/ch/decl.c:4451: error: argument ‘code’ doesn’t match prototype
/home/konings/software/gcc-2.95.2/gcc/ch/ch-tree.h:736: error: prototype declaration
make[2]: *** [decl.o] Error 1
make[2]: Leaving directory `/home/konings/software/gobj/gcc/ch'
make[1]: *** [cc1chill] Error 2
make[1]: Leaving directory `/home/konings/software/gobj/gcc'
make: *** [all-gcc] Error 2
(if anyone wants me to post the full output, let me know). Here again, the internet and the archives of this forum don't seem to be helping me find solutions. Anybody know what I am doing wrong?
 
Old 11-18-2007, 12:40 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
You will have to make distclean first to get rid of all of the old configuration files and makefiles. Have you done that? Or just delete your entire build directory and start over.
ta0kira
 
Old 11-18-2007, 12:45 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
The actual gcc compiler front end contains a version number in the filename so you can install more than one version of compiler. It is what would be called to perform the compiling if you use the "-V" option. The /usr/bin/gcc file will actually be a link to the most current version. gcc -> gcc-4.1.2 in your case.
 
Old 11-18-2007, 03:08 PM   #6
hydrogeek
LQ Newbie
 
Registered: Nov 2007
Location: Cambridge, MA
Distribution: Fedora
Posts: 4

Original Poster
Rep: Reputation: 0
ta0kira:
Yes, I've been doing make distclean between all my tries. I haven't tried deleting the entire build directory, though. I'll try that. Thanks!

jschiwal:
Thanks for the info! I'm not sure how to apply that here, though. When I had installed the gcc using --prefix, I had edited my makefile to point specifically to that version of the compiler (hence it showed up as the -v output). Do I need to change anything else in /usr/bin on top of that (or create any symlinks)?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple versions of GCC Denisius Slackware 11 11-15-2007 08:39 AM
gcc versions compatibility with kernel versions.. mahesh_manthapuri Suse/Novell 1 03-22-2006 01:28 AM
multiple versions of gcc Avatar33 Linux - General 3 02-22-2005 03:06 PM
multiple gcc versions and selectability tincat2 Linux - Software 1 06-08-2003 03:38 AM
GCC include path. jwilson Linux - General 1 04-02-2001 04:58 PM


All times are GMT -5. The time now is 05:25 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