简体   繁体   中英

C++ compiling an application with 32 and 64 bit libraries

I am trying to compile and link the Assimp library for model loading. It will compile, but keeps throwing a LNK2019 error at me, and its had me stuck for days. The libraries I have in my project are GLFW, GLAD, SOIL, GLM, and now I am adding Assimp 64 bit.

I am trying to compile and link with Assimp 64-bit, however my configuration build is set to build an x86 application (this was just default I left as this is a test project), I am unsure about those other 4 libs, such as GLAD and GLFW, if they are 64-bit or 32-bit.

My question is, can I still use a 64-bit library if my Visual Studio configuration is set for 32-bit? Will it just convert the 64-bit lib to 32-bit? What about vice versa?

Could I be getting the LNK2019 error ("Unresolved External Symbols") because the library is a 64-bit version even though I am compiling as 32-bit? ( .lib file has been added to directories and as a dependency already, so it knows exactly where to find the defined functions. It just won't do it for some reason, and throws a LNK2019 error).

Does it matter if GLFW is 32-bit but Assimp is not?

can I still use a 64-bit library if my Visual Studio configuration is set for 32-bit?

No, you cannot use a 64-bit library in a 32-bit project, and vice versa. You need 32-bit libraries for a 32-bit project, and 64-bit libraries for a 64-bit project.

Will it just convert the 64-bit lib to 32-bit?

No, it will not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM