Question

Can someone link me a good guide for using libraries in a c or c++ project?

Right now I'm trying to add OpenCV to a newly created project. I've added all the directories I can think of in "Project and Solutions -> VC++ Directories" and to make sure I've dragged and dropped all the .lib and .dll files into the project.

The project builds but when I run the simple "Hello, World program" it gives me this error message:

"cv.exe unable to locate component.

This application has failed to start because cv200.dll was not found. Re-installing the application may fix this problem."

How can I really add this cv200.dll? I've dragged&dropped it into the project.. Thanks!

Was it helpful?

Solution

You need to make sure that cv200.dll is in the DLL search path at run time. The easiest way to do this is to put it in the same directory as the built executable. Dragging and dropping a DLL or LIB file into your project has no effect.

MSDN has a good description of the full DLL search order when loading libraries at runtime.

OTHER TIPS

By default during installation OpenCV create env. variable path \bin. All dll assumed to be in that dir. However you are using OpenCV 2.0, and OpenCV 2.0 installation doesn't include lib and dll files for Visual Studio. You seems already built all dll's and lib's. If you installed OpenCV correctly just move all dll's into \bin (for example C:\Program Files\OpenCV\bin) If for some reason you are missing some dll or libs here is instruction how to build them http://mirror2image.wordpress.com/2009/10/20/switching-to-opencv-2-0-with-vs2005/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top