Install OpenCV 2.31 for visual studio 2008

The OpenCV latest version is  2.31 for now (Sep 13, 2011).  There are many new modifications for this improvement. 

 

Also there are some problems for running this version.

Now, the official website of OpenCV does not contain manual for OpenCV 2.31 and VS2008. (At current time Sep 13 2011).

 

Download the latest version of OpenCV 2.31 from http://opencv.willowgarage.com/wiki/.

Extract all the file using the file “OpenCV-2.3.1-win-superpack.exe”

We need the CMake to configure and VS to compile the source files.

Let’s use “$opencv_home” to stand for the directory where the OpenCV files extracted.

Then we could employ Cmake to specify the directory where the binary file are generated, in my case, it is “$opencv_home/build”.

We could generate debug and release version respectively:

$opencv_home/build/install/debug/

$opencv_home/build/install/release/

Under debug/release directory, there will be three folders:

include/,  bin/, lib/,

“include” and “lib” file could be added into the VS2008 project following:

Tools –> Options –>Projects and Solutions –> VC ++ Directories

*.lib file should be added following:

Project –> Properties –> Linker –> input –> Additional Dependencies

The “bin” directory contains the dll files, and we should make sure the running program could localize necessary DLL. There are many methods:

  1. copy these dll files into $system or $windows/systems directory
  2. add the dll directory path to the system environment variable “$PATH”
  3. copy all these dll files into the current project executing path.

 

 

 

 

2 thoughts on “Install OpenCV 2.31 for visual studio 2008

  1. The Godfather says:

    When I try to compile test code, “hello world”, I get an error on line “#include “opencv2/core/core_c.h”, no such file”. And it’s right – my folder “OpenCV\include\opencv2” contains only one file – opencv.hpp. How can I fix this problem?

    • The Godfather says:

      Found solution – these headers were in source folder (After extracting OpenCV-2.3.1-win-superpack.exe) \build\include\opencv2

Leave a comment