4

I have downloaded the Assimp project from http://assimp.sourceforge.net/main_downloads.html

Assimp release image

assimp zip image

And I've also downloaded the cmake x86 version from this link: https://cmake.org/download/

cmake x86 image

I have extracted both, and made a build folder next to the assimp's folder. After that I have opened a command promt, changed the directory to the mentioned build folder. I gave the cmake.exe's path to the command promt and the assimp folder's path as the first parameter. After that I had the visual studio solution in the build folder. I have made an assimp folder in my openGL project. In this assimp folder I've created a lib folder and I put everything from the build/code/debug folder into it, namely:

assimp-vc140-mt.dll
assimp-vc140-mt.exp
assimp-vc140-mt.ilk
assimp-vc140-mt.lib
assimp-vc140-mt.pdb

After that I copied the include folder from the downloaded assimp folder next to the previously mentioned lib folder. So now I have all the libs and includes inside my openGl project I have set the additional include directories, the additional libraries and the additional dependencies in the visual studio for my openGl project

In my main.cpp I have included these headers:

include "assimp/Importer.hpp"
include "assimp/scene.h"
include "assimp/postprocess.h"

I can build my project and run it. But when I run it after the console appears I immediately get this error:

assimp-vc140-mt.dll was not found

I don't know what could be the source of the error, do you have any idea?

Thank you in advance!

Błażej Michalik
  • 4,474
  • 40
  • 55
Viktor Korai
  • 177
  • 2
  • 13

1 Answers1

6

Don't forget dependant DLLs which are not system DLLs are loaded from application directory and from current directory - to me it sounds like you haven't put assimp-vc140-mt.dll in either of those.

CookiePLMonster
  • 195
  • 3
  • 11
  • Okay that helped, thank you. Could you tell my why I have to put this dll into the exe 's directory but I don't have to do the same with the glew and soil and other libraries? I'm pretty new in c++ so sorry for the dumb question. – Viktor Korai Jan 14 '18 at 20:55
  • glew may be linked dynamically from the code from an appropriate directory. For implicit linking, DLLs follow [Dynamic-Link Library Search Order](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx) Either that, or you're linking "other libraries" statically, as in their code ends up being embedded in resulting executable directly. – CookiePLMonster Jan 14 '18 at 21:01