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

Started by
1 comment, last by 21st Century Moose 10 years, 10 months ago

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?

Advertisement

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.

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement