Search code examples
windowsvisual-studio-2012dllvtk

Missing DLL even though the directory containing it is in the path


I'm currently trying to build and run some of the example of the VTK. Building goes just fine, however when trying to run the examples I have some missing DLLs errors. I am using windows 8.1, Visual Studio 2012. My path actually include the directory where all the dlls are stored. The dlls are stored in:

C:\Program Files (x86)\VTK\bin\

My path value is:

C:\cygwin64\bin;C:\Program Files\Microsoft MPI\Bin\;C:\Perl64\site\bin;C:\Perl64\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\CMake\bin;C:\Program Files\doxygen\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Users\Lonni\Dev Utilities\gluegen\gluegen-2.3-b858-20150410-windows-amd64\gluegen-2.3-b858-20150410-windows-amd64\jar\gluegen-rt.jar;C:\Users\Lonni\Dev Utilities\jogl-2.3-b1392-20150410-windows-amd64\jogl-2.3-b1392-20150410-windows-amd64\jar\atomic\jogl.jar;C:\Program Files (x86)\Git\cmd;C:\OpenSceneGraph-3.0.1-VS9.0.30729-x64-release-12741\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\VTK\;C:\Program Files (x86)\VTK\bin\

I first thought a typo was in my path and I have found a missing ";". But now that it's corrected it is still not working and I still get the missing dll error when trying to run my program.

Any help would be appreciated on that matter.

EDIT: Finally I had it wrong, now when I try to launch the exe file directly without VS it works just fine. However, when trying to launch it from within VS I get the DLL error.

Thanks in advance


Solution

  • In VStudio, go to your application project properties, select Debugging -> Environment, add PATH=$(path to the folder where your .dll is located); (for in-solution folders using relative paths).