Jump to content
  • Advertisement
Sign in to follow this  
DrEvil

Linux compiling

This topic is 4885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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...

Share this post


Link to post
Share on other sites
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
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!