-1

Following up from this post: Errors in Upgrading VC++ project from VS 2010 to VS2012

Now extracted opencv 3.1.0 to C:\ drive. Have a VS 2012 program that cannot find cv.h header file, with 2 identical errors but in different cpp files. This is the error:

Cannot open include file: 'cv.h'

Does anyone know where by default I should extract the opencv program to so VS can find it? I know about adding include and lib paths, so I used C:\opencv\ and that should have worked but it didn't. The docs on the site describe how it's done for VS2010 and I haven't found nay docs that describe how to do it in VS2012

Community
  • 1
  • 1
user02103012
  • 61
  • 1
  • 7

1 Answers1

1

Not sure how you have configured your solution so far. However, this is how I do it:

  1. Set OPENCV_DIR environment variable to D:\libs\x64\opencv_3_1_0\build\x64\vc12 (of course adapt it to your installation)
  2. Create property sheet in Property Manager tab (View/Other windows/Property Manager)
  3. In C++/General/Additional Include Directories add $(OPENCV_DIR)\..\..\include
  4. In Linker/Additional Library Dependencies add $(OPENCV_DIR)\lib
  5. In Linker/Input - for debug solution configuration all .lib files from lib directory with "d" before file extension (for example opencv_world310d.lib), for release configuration all remaining.

Create separate property sheets for debug/release x86/x64. Now, when creating new solutions, you just add existing property sheets and have OpenCV configured.

BartekM
  • 106
  • 3
  • 8