Linux compiling

Started by
4 comments, last by dotproduct 18 years, 10 months ago
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
Advertisement
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...
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.
hmm damn, can different versions of gcc co-exist on linux? if so how do you tell which one is used ?
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.
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...



This topic is closed to new replies.

Advertisement