Jump to content

  • Log In with Google      Sign In   
  • Create Account

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

  • You cannot reply to this topic
2 replies to this topic

#1   Members   


Posted 15 June 2013 - 03:39 PM

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?

#2   Members   


Posted 15 June 2013 - 04:05 PM

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, 15 June 2013 - 04:07 PM.

It's perfectly fine to abbreviate my username to 'Servant' or 'SotL' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal | [Fly with me on Twitter]

#3   Members   


Posted 16 June 2013 - 10:52 AM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.