0
votes

I had generated the 32-bit project version when running CMake, instead of 64-bit.

I've been following the OpenGL tutorial over at ogldev, and got to the section about loading models into the application. For whatever the reason, I get linker errors (e.g. "LNK2001 unresolved external symbol aiGetMaterialTextureCount") whenever I try to launch my application, after adding Assimp. I'm using Visual Studio 2019.

What I've done to add the Assimp dependency is:

1- I've added the assimp\include folder to my Configuration properties\VC++ directories\Include directories and Reference directories, as well as under C/C++\Additional include directories.

2- I've built the assimp project, using CMake (with boost), and created the assimp\lib folder (for 64-bit, since my application is also 64-bit). I copied assimp.dll to my project's x64\Release folder, and added the assimp\lib folder to VC++ directories\Library directories, and to Linker\General\Additional library directories. assimp.lib was added to Linker\Input\Additional dependencies.

Is there a step I missed along the way? What should I do?

1
Please share your cmake file. It is hard to figure out what went wrong without it. And have you added the assimp-importer lib for the same configuration ( 32bit/64bit ) to your cmake file? - KimKulling

1 Answers

0
votes

If you want to use the 32-bit version of the Asset-Importer-Lib you have to generate the 32-bit version for it as well.

The 64-bit- and the 32-bit-binaries from the build are not compatible. And that is the reason for your unresolved symbol you get from your build.

So to fix that generate a 64-bit-version for you application.