Jump to content
  • Advertisement
Sign in to follow this  
Geometrian

Choosing the Correct Shared Library

This topic is 2499 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

Hi,

I'm running into a recurring problem, and I don't know how to solve it cleanly. The issue is that I need to link to shared objects. The problem is that the 32 bit and the 64 bit version have the same name.

I have both libraries, but of course the file system won't permit them to reside in the same place.

How can I make my code choose the right one?

Thanks,
-G

Share this post


Link to post
Share on other sites
Advertisement

Keep the binaries in separate folders?

bin/x86
bin/x64


And/or give the libraries different names and use a preprocessor macro to control the name of the library you load e.g.


#if defined(BUILDING_32BIT)
const char *libname = "thelib32.dll";
#elif defined (BUILDING_64BIT)
const char *libname = "thelib32.dll";
#else
#error "doh"
#endif


If you happen to be on OS X, use lipo instead.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!