Sign in to follow this  
shocobenn

Library 64/32Bits is not depending of the 64/32Bits OS ?

Recommended Posts

shocobenn    273

Hello ! This is only a question, the problem is solved but i don't really understand something with the libs.

 

I'am actually on windows 8 64 bits and I was setuping an opengl project using glew in VS2012. So i downloaded the 64bit version of glew (because i thought it depended of the OS) and linked the libs, includes the headers, etc... (I use the static version)

 

All was well placed, but when i builded the library, i had linkage problems.

 

Then i replaced the glew 64 bit by the 32 bits version and all worked as wanted, so i concluded that a library version doesn't depend of the OS version, isn't it? So of what does it depend ? Is it a configuration in the IDE?

Share this post


Link to post
Share on other sites

The library compile settings (32 bit or 64 bit, compiler name mangling, what underlying exception-handling method, debug mode or release mode, single-threaded or multi-threaded, etc...) need to match the executable that is linking to the library. This is why it's almost always easier to download the library source, and compile the library with the same compiler and settings that you compile your executable, so you can be confident that it lines up. Ofcourse, some libraries are a pain to compile. laugh.png

 

If you downloaded a 64 bit version of the library, but you are accidentally compiling a 32 bit executable, then there will probably be a conflict.

Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
mhagain    13430

It's not dependent on the OS, it's dependent on whether your project is set up to build a 32-bit or 64-bit executable.  64-bit Windows is capable of building and running either kind, and you get to choose which.  The important thing is - if you're building a 64-bit executable you must link to 64-bit libraries, if you're building a 32-bit executable you must link to 32-bit libraries, and the latter applies even on a 64-bit version of Windows.

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