views:

360

answers:

3

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'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 :)

+1  A: 

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.

tzaman
Great if this works. It sure wasn't enough for me back then. :)
Virne
A: 

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.

Virne
A: 

I have a similar problem -- trying to compile openCV on an ultraportable PC (Viliv S5), that does not have multi-processors (an Atom processor).

In your reply you suggested to "disable OpenMP support if that's the problem".

How do I disable OpenMP support so that openCV (2.0.0) can compile with VS 2008 on an atom processor?

Thanks!!!

Luis Goncalves