Tuesday, December 15, 2009

Building OpenCV 2.0 with Visual Studio C++ 2008 Express Edition

Hopefully I will spiff this post up with some screenshots, but for now, let me just quickly note the steps that were required to get this to build.

  1. Download and install VS C++ Express Edition
  2. Download and install CMake. When the install asks, don't bother having it put on your System Path.
  3. Download and install OpenCV 2.0. There is a Windows installer. Note: This does not install a working open cv library . . . it is just the source files. Again, don't bother having the installer put OpenCV on your system path.
  4. Run the CMake GUI in your CMake installation. For the source directory, indicate the OpenCV directory (probably C:\OpenCV2.0). For the build directory, specify a build directory that you've created (recommended: C:\OpenCV2.0\release).
  5. Click the Configure button.
  6. In the configuration options, disable OpenMP. You probably won't have this if you are using VS C++ Express Edition.
  7. Click the Configure button again. Then click Generate.
  8. Go to your build directory (C:\OpenCV2.0\release). Open the Visual Studio Solution file. Once you're in Visual Studio, build the project (f7). This will take a while.
  9. You're done. When you create new projects, use the Lib and Include files in your build directory. (You'll need to add these to your Project properties). I'll try to explain more later and maybe include a sample test project.