Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My development machine is running Precise, but some of my target servers are still running Lucid. I'm trying to set up my dev machine so that it can compile c/c++ for both Lucid and Precise. I already ran

aptitude install gcc-4.4 g++-4.4

on my dev machine but that unfortunately installed version 4.4.7 of the compilers where Lucid is running version 4.4.3.

After some googling, I found this:

http://packages.ubuntu.com/lucid/devel/gcc-4.4

which seems to be exactly what I want. Would adding this Lucid package to the Precise source.list even work considering that this package was not meant for Precise? If so, exactly what url should I add to the source.list file in order to get it?

note: I'm not really looking to compile this from source if I don't have to. I'm not even sure if gcc/g++ 4.4.3 will even solve my problem.

I also acknowledge the possibility that I'm going about this all wrong. Is there a better or simpler way to compile for older versions of linux on Precise?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Forget about GCC, your BIGGEST problem with the way you're going will be dependencies/libraries; the ones in Precise are usually much newer than Lucid.

The right way to build Lucid apps in Precise is to create a Lucid chroot and build inside it.

share|improve this answer
    
I'm in the middle of setting up the chroot environment right now. Will I be able to run a gui ide (e.g. eclipse) or will I have to build via the command line? –  user1034772 Jul 30 '12 at 20:44
    
Sure, you can run IDE or any GUI app -- please see help.ubuntu.com/community/… –  izx Jul 30 '12 at 20:46
add comment

No, it's risky and you can break your system, also if you want gcc-4.4 just install it from the official repos in Precise.

share|improve this answer
    
The problem is that the Precise repo only has gcc-4.4.7, and it seems that I need 4.4.3. –  user1034772 Jul 30 '12 at 17:54
    
in this case just download the source of gcc and compile the version that you need, after that you can use update-alternatives to use your newly created gcc gloabally or just make some references to it. –  user827992 Jul 30 '12 at 17:56
    
@LordofTime no, update-alternatives is designed just to avoid that. –  user827992 Jul 30 '12 at 18:43
    
I checked out gcc's source from the gnu site, but I'm a little weary on compiling it before I read up a little more on the build process. Being that 10.04 is still supported, I'm finding it surprising that it's so much of a hassle to build application's for it on 12.04. I'd really rather find another option to do this without compiling gcc/g++ from source. –  user1034772 Jul 30 '12 at 19:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.