Building and Installing OpenCV 2.x / 3.x with MSVS

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Building and Installing OpenCV 2.x / 3.x with MSVS

Building and Installing OpenCV 2.x / 3.x with MSVS

Post by Creator » Thu Dec 10, 2009, 19:36

I use OpenCV with MS Visual Studio. As it happen, one absolutely have to read buried in the download section readme, before doing anything. The thing is, OpenCV doesn’t include lib files for VS. They have to be built by user.
So here is step by step retelling of readme:
  1. Download and install OpenCV
  2. Download and install CMake
  3. Run cmake-gui.exe
  4. In the “Where is the source code” field choose your new OpenCV directory (C:\OpenCV\sources)
    In “Where to build the binaries” choose directory for VS compiled OpneCV (C:\OpenCV\builds)
  5. Press Configure button and choose Visual Studio 14 2015 or Visual Studio 14 2015 Win64 (or whatever) as building environment
  6. Press one more time Configure and then Generate, so the VS project will be generated in the C:\OpenCV\builds
  7. Open the solution and build it for Release and Debug configurations
  8. Build also the INSTALL project in the solution (again for Release and Debug configurations). That will copy OpenCV headers and binaries to C:\OpenCV\builds\install
  9. Now you can copy the content of the C:\OpenCV\builds\install to another folder, e.g. C:\OpenCV\build
  10. Reconfigure your application project:
    • Include directories are C:\OpenCV\build\include\opencv and C:\OpenCV\build\include\opencv2
    • Additional library directories are C:\OpenCV\build\[x86|x64]\vcXX\lib
    • The dll files are in C:\OpenCV\build\[x86|x64]\vcXX\bin

Top