Question:
How do you set up OpenCV in Visual Studio 2008 C++?
Stuart
2010-03-20 14:59:22 UTC
System setup: Win 7 32bit, OpenCV 2.0.0a, Microsoft Visual Studio 2008 C++ Express Edition
Project aim: track two simple lights.

Spent hours on this but seems like everyones got different solutions to diferent style problems.

I have been following install guide here:
http://opencv.willowgarage.com/wiki/InstallGuide

Ive downloaded OpenCV 2.0 from sourceforge: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.0/

Downloaded Cmake here:
http://www.cmake.org/cmake/resources/software.html

The "Building OpenCV from source using CMake" section confuses the hell out of me and im sure im doing it wrong but believe it may all be unnecessary as i found this site:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B
which tells me to do the following:

OpenCV has all the dll's in the bin directory and i copy them across to my project source code folder.
OpenCV has a lib/opencv and include directory already which i can set up in the MSVC++ 2008 environment

I go to project->properties->Linker->input->Additional dependencies and put in:
cv.lib cxcore.li highgui.lib

I then put these header files in project:
#include
#include
#include

And i finish with LINK : "fatal error LNK1104: cannot open file 'cv.lib'"
Three answers:
2010-03-20 15:42:31 UTC
Hi,



Follow the instructions given here in the link. It worked perfectly for me.



Varun
?
2016-12-10 23:32:20 UTC
Opencv Visual Studio 2008
?
2010-03-24 08:06:20 UTC
on the command prompt enter the following:

echo %lib%

in case the file cv.lib is not in one of the directories listed there, you have to add this directory to your environment variable lib



or



tools>options, expand "Projects and Solutions" and add the directory (where your cv.lib is located there) to VC++ Directories



I hope this helps with your cv.lib problem


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...