I am writing a C++ application in Visual Studio 2010 which is meant to use MATLAB for graph plotting. In order to do so I added the MATLAB dll directory in my solution:
Properties -> Debugging -> Environment -> "PATH=F:\MATLAB R2010b\bin\win32"
as well as in:
Properties -> Linker -> Input -> Additional Dependencies:
I also needed to include headers to MATLAB engine:
When I run my program directly from VS (start without debugging) it works properly, however if I build the app and then start the executable, it gives me an error:
I tried to copy the file from the directory mentioned above but then it asks for another and another until I got tired of copying all the libraties. I copied the executable to the directory "F:\MATLAB R2010b\bin\win32" and then the program works properly.
Could not locate something.dll
How can I make VS copy all the files for me or somehow tell the program to look for them in the matlab directory? What is the common programming practise on handling the dll libraries?