How to add OpenCV files in Visual Studio

  1. Extract the OpenCV install in any directory you want.
  2. Copy the path of the directory where you extracted the OpenCV and add it to your System PATH.
  3. Restart your computer to allow it to recognize new environment variables.
  4. Open the properties of the project in Visual Studio and select VC++ Directories
  5. Select Include Directories and select the path where OpenCV was extracted and add \build\include.
  6. Now Select Library Directories and select \build(processor_type)\vc12\lib.

    processor_type can be x86 or x64.

  7. Now select Linker->Input->Additional Dependencies and add all the files there. Name of the files can be found here.

  8. Compile the project and start using the OpenCV in Visual Studio.

Leave a Comment