LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 06-27-2012, 08:54 PM   #1
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 56

Rep: Reputation: 15
install gcc 3.4 along side gcc 4 problem on ubuntu 11.10


Hi all,
I have an ubuntu 11.10 server which I mainly use for text game development. I was considering using a text game codebase which is no longer supported but I have been told is easily maintainable. For that reason, I tried compiling it... but lots of errors occurred when doing so. I was told by the same people that it compiled fine under gcc 3.x, so I installed gcc 3.4 from the hardey repos. Now gcc is installed, but it can't create executibles because (so I've been told) binutils is not installed or something similar. I would just do apt-get install build-essential, but I already have that package with gcc 4, I need all the other things that work with gcc 3.4. So that leads me to my question: How to install binutils and other required software for gcc 3.4 along side all the required software for gcc 4?
Thanks,
-Michael.
 
Old 06-28-2012, 04:39 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,199

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
First : You can have as many versions of gcc as you want,
installed at the same time.

But : No old Ubuntu compilers will work in Ubuntu 11.04, 11.10 etc.
It's not about binutils or any other package :
The gcc binary is hard coded with certain search path's.
And the later Ubuntu's have got new hideaway locations for :
libgcc_s.so.1, { crt1.o crti.o crtn.o },
"/usr/include/": asm/: bits/: gnu/: sys/ .

"gcc" has search path's for finding files in it's own directories.
The missing files can be copied or linked into "old gcc" :
Then the modifications will not alter your system files.
Example : A "gcc41-compat 11.04" modified for 11.10 ..
Code:
sudo cp -a /usr/include/i386-linux-gnu/asm/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/ 
sudo cp -a /usr/include/i386-linux-gnu/bits/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/
sudo cp -a /usr/include/i386-linux-gnu/gnu/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/
sudo cp -a /usr/include/i386-linux-gnu/sys/ /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/include/

## crt1.o  crti.o  crtn.o :
sudo cp /usr/lib/i386-linux-gnu/crt* /usr/gcc41/lib/gcc/i386-linux-gnu/4.1.2/

## /usr/gcc41/lib/ : 
sudo rm libgcc_s.so*
sudo cp /lib/i386-linux-gnu/libgcc_s.so.1 /usr/gcc41/lib/
## /usr/gcc41/lib/ : 
sudo ln -s libgcc_s.so.1 libgcc_s.so
Links :
gcc41-compat 11.10 https://docs.google.com/open?id=0B7S...NjZmMHkyaE9Odw
g++41-compat https://docs.google.com/open?id=0B7S...hjMjljN2M2MGU4
gcc34-compat 11.04 https://docs.google.com/open?id=0B7S...gxNGI0MTQ4YTY4
g++34-compat https://docs.google.com/open?id=0B7S...RkMWIxMzIyNDEz

.

Last edited by knudfl; 06-28-2012 at 04:50 AM.
 
  


Reply

Tags
binutils, compilation, gcc, ubuntu 11.10


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install gcc when a current gcc is installed but not responding Nadishka Linux - Newbie 6 10-15-2009 03:33 PM
yum install gcc doesn't set the lastest gcc ver 4.3.x kim,jw Linux - Newbie 3 12-22-2008 11:51 PM
pkg-get install gcc ERROR: gcc unrecognized Raidmax Solaris / OpenSolaris 10 08-30-2007 12: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


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