Assimp model loading library install/linking troubles

╄→尐↘猪︶ㄣ 提交于 2019-12-05 05:26:14

I've just recently done this myself & will say had lot of trouble with v401 & getting errors or linking issues. Successfully got mine working with following;

Note: ASSIMP does have boost as a dependency.

  1. Download/clone master Asset-Importer-Lib from github: https://github.com/assimp/assimp
  2. Open Cmake GUI & once open:

    • Where is the Source code: "..\MyDocuments\assimp\assimp-master"
    • Where to build the binaries: "..\MyDocuments\assimp\assimp-master\build". You will need to make a build folder & point Cmake to it.

    2.1. Alternatively if you're familiar with command line option: generate project files with relevant paths using

    • cmake -G”Visual Studio 14 Win64"
  3. Click configure.
  4. Then Generate. Make sure you select correct build option ie VS15 2017 64bit.
  5. Load "..\MyDocuments\assimp\assimp-master\build\Assimp.sln" with Visual studio.
  6. Right click "ALL_BUILD" & select "Build". This will take several minutes. Once done & no errors, it should create necessary *.dll/*.lib in ..\MyDocuments\assimp\assimp-master\build\code\Debug
  7. Link & include into your existing project the relevant *.lib & also "..\MyDocuments\assimp\assimp-master\include\assimp" folder. You will also need to make sure *.dll file is in the same folder, or included, as the *exe you're running.
  8. You may also need to copy over from the ..\MyDocuments\assimp\assimp-master\build\include\assimp\config.h" & include it in step7.

Just ensure you're building right libraries for your code ie 32/64bit/debug/release/unicode/etc, otherwise may encounter issues still.

Following video is useful for the visually inclined. https://youtu.be/W_Ey_YPUjMk

Hope this helps.

EDIT: If you want static library version ie no .dll required: From above steps:

5.1. Change relevant project configuration type & extension from .dll to .lib type (should be two: assimp & zlib).

5.2. Right click "UpdateAssimpLibsDebugSymbolsAndDLLs" ->Properties->Build Events & update the paths in the command line sections from ..\Path*.dll to ..\Path*.lib. (If encounter errors, do same on assimp_cmd project).

  1. Same as above but now also need to link your project to IrrXML.lib & zlibd.lib. Should no longer need the *.dll file.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!