Installing & Configuring with Visual Studio

Installing Opencv c++ tutorial
How to Install And Configure OpenCV with Visual Studio
Steps for Installing & Configuring OpenCV with Visual Studio in Windows 10. Using:
  • Windows 10 64-bit
  • Visual Studio Community Edition 2015 Update 1
  • OpenCv 3.1.0
  1. Download and install Visual Studio 2015 Community Edition. It's free and choosing all default option including VC++ will work fine.

  2. Download latest version of OpenCV. I am using OpenCV 3.1.0

  3. Make a folder of your OpenCV version. for example "C:\OpenCV-3.1.0"

  4. Add the bin directory of OpenCV to the operating system path.
    a) Go to: System Properties -> Advanced Sytem Settings -> Environment Variables -> Edit Path Variable
    b) Add new path value to "C:\OpenCV-3.1.0\opencv\build\x64\vc14\bin" and Apply Changes.

  5. OpenCV Advanced System Settings

    OpenCV Environment Path Setup

  6. Start Visual Studio, choose File->New->Project


  • Choose Visual C++, Empty Project, name your project, example "Test", Set preferred location, uncheck "Create directory for solution" and "Add to source control", Choose Ok.

  • Right Click in Solution Explorer,Choose Add -> New Item. Choose "C++ File", name the file, example "ObjectTracking.cpp". Choose Add.

  • In the Visual Studio toolbar, verify that "Solution Configurations" is set to "Debug", then change "Solution Platforms" to "x64"

  • OpenCv Visual Studio Debug x64

  • In VS 2015 go to:
    a) Project -> (project name) Properties -> Configuration Properties -> VC++ Directories -> Include Directories add the include directory for your version of OpenCV, ex "C:\OpenCV-3.1.0\opencv\build\include"
    b) Project -> Properties -> Configuration Properties -> VC++ Directories -> Library Directories: add the library directory for your version of OpenCV, ex "C:\OpenCV-3.1.0\opencv\build\x64\vc14\lib"
    c) Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies: Copy/paste the name of the debug lib(s) in the lib directory, ex "opencv_world310d.lib"

  • Done ! You are ready to write code and Run your program.

  • Like, Share and Comment Below

    6 comments:

    1. Getting error unable to create empty project in VS 2015 Community Update 3. I reinstalled it but still got the same error. 'Project type .vcxproj is not supported by this version of the application'. Help me Please ?

      ReplyDelete
      Replies
      1. Uninstall Visual Studio 2015 Update 3 and Try Installing Visual Studio 2015 Update 1 .iso Installer

        Delete
      2. Thanks Bro.. Finally Worked :)

        Delete
    2. Hi,

      I follow all your steps, but when I try to execute a program in order to test opencv functionalities, the debug quit the execution with an error : debug error, abort () has been called

      ReplyDelete
    3. thank you so much.. work like a charm :)

      ReplyDelete
    4. I tried running cannystill on visual studio but brings an error "LNK1104"
      What sould I do

      ReplyDelete