Building an OpenCV application with Visual Studio 2008 and running it from another computer
I've made a simple OpenCV application with Visual Studio 2008 and I've built it in both release mode and debug mode.It works fine from my computer but when I try to run it from another computer which doesn't have OpenCV installed or has another version of Visual Studio with OpenCV it doesn't work.
How can I make the app work from a computer which doesn't have either Visual Studio or OpenCV installed ?
I开发者_StackOverflow'm thinking to add the external dependencies ( lib's and dll's ) into the app's folder, change the path in Visual Studio and rebuild it.
Thanks in advance and sorry for the ultranoobish question :)
You don't need to distribute the libs; those are just needed for building the executable.
Just copy the dlls somewhere where the executable can see them (either in the same dir as the exe, or in a dir that's on the system path) and you should be golden.
Copying DLL's with the application or to the path is a good start, but may not be enough. It took me a long time to find out why OpenCV application didn't work on another machine. Visual Studio runtime and OpenMP are used by OpenCV. Those are not installed by default and error messages, if any, are not all that helpful.
You need to build OpenCV and your application with setting (in Visual Studio): Configuration Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded (/MT) You need to disable OpenMP support too if that's the problem. Build system changed with OpenCV 2.0. If I remember right, older version had different project files for version without OpenMP.
精彩评论