Sign in to follow this  
DrEvil

Linux compiling

Recommended Posts

DrEvil    1148
I'm running gcc 3.x (dont remember exactly) in debian sarge, but I need to compile some linux shared libraries for a game using 2.95 runtime libraries/headers. Is there a way to do this without replacing my newer gcc with old ones? Thanks

Share this post


Link to post
Share on other sites
dotproduct    180
I don't belive so, someone correct me if I'm wrong.

c++ code compiled with gcc 2.95 is not binary compatible with code compiled with 3.x.

What you probably could do, is apt-get install gcc-2.95, and then use g++-2.95 to compile...

Share this post


Link to post
Share on other sites
Kwizatz    1392
I think they are compatible, anyway, you may also try downloading the gcc-2.95 source and compile it passing --prefix=/usr/local/gcc-2.95 to the configure script.

you'd probably need to adjust paths and enviroment variables for it to work, but I am not sure, never tried it.

Share this post


Link to post
Share on other sites
DrEvil    1148
hmm damn, can different versions of gcc co-exist on linux? if so how do you tell which one is used ?

Share this post


Link to post
Share on other sites
Kwizatz    1392
I've only done it for cross compilation, in those cases the new compiler gets instaled (for example for i386-pc-mingw) at $prefix/i386-pc-mingw and links are created to each binary in $prefix/bin as i386-pc-mingw-gcc,i386-pc-mingw-ld, i386-pc-mingw-gcc, etc, so you use those instead, in theory autotools should be able to cross-compile any source by feeding --target=i386-pc-mingw to the configure script, but in practice, it only works if the author took measures to allow this.

Share this post


Link to post
Share on other sites
dotproduct    180
Quote:
Original post by DrEvil
hmm damn, can different versions of gcc co-exist on linux? if so how do you tell which one is used ?


Debian has several different versions of GCC available and they can co-exist, no problem...
They are all named with a version, so the c++ compiler from gcc 3.3 is /usr/bin/g++-3.3, etc...
Which one is used by default depends on what the /usr/bin/g++ symlink points to...

And 2.95 and 3.x is NOT binary compatible. Which is why you have to compile your shared libraries to run the game...



Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this