Problem setting up opencv 2.2 on Windows 7 (64-bit):

I have Windows 7 (64-bit) and I'm trying to configure opencv 2.2 for Microsoft Visual Studio 2010, I followed the instructions in the OpenCV 2 book "Book on Programming Computer Vision Applications" , but it doesnโ€™t work, I completed next steps:

  • Compile opencv 2.2 with cmake, (source: C: /OpenCV-2.2.0, where to build the binaries: C: /OpenCV-2.2.0/build)
  • Open OpenCV.sln (which is created by compiling cmake in the C: \ OpenCV-2.2.0 \ build folder), it opens in visual studio, I build it (build result: no errors, several warnings).
  • Add a new properties page to my project, and in the VC ++ directories in the "Include Directories" section I give the path to C: \ OpenCV-2.2.0 \ include \ opencv and in the "Library Directories" section I pass the path of my lib files, t .e. C: \ OpenCV-2.2.0 \ build \ lib \ Debug.
  • The following additional dependencies are included on the linker tab under the tab:

    opencv_core220d.lib

    opencv_highgui220d.lib

    opencv_features2d220d.lib

    opencv_calib3d220d.lib

According to the instructions in the book, everything should now be correctly configured, but when I include the header files (after entering (Hash) include (angle bracket)), intellisense only gives:

#include <cxcore.h> #include <cv.h> 

but instead he had to display

 #include <opencv2/core/core.hpp> 

and when i write

 #include <opencv2/core/core.hpp> 

it gives me an error, cannot open the source file "opencv2 / core / core.hpp" if I include

 #include <cv.h > 

I got 11 errors:

 1. IntelliSense: cannot open source file "opencv2/core/core_c.h" c:\opencv- 2.2.0\include\opencv\cv.h 63 1 2. IntelliSense: cannot open source file "opencv2/core/core.hpp" c:\opencv-2.2.0\include\opencv\cv.h 64 1 3. IntelliSense: cannot open source file "opencv2/imgproc/imgproc_c.h" c:\opencv-2.2.0\include\opencv\cv.h 65 1 4. IntelliSense: cannot open source file "opencv2/imgproc/imgproc.hpp" c:\opencv-2.2.0\include\opencv\cv.h 66 1 

[Other errors are similar to the errors above.]

I did not add anything under C / C ++ -> General -> Additional Include directories in the property sheet, is there a need to include something there?

Can anyone tell me what I did wrong during the setup process?

Is there any manual specifically designed to configure opencv 2.2 on Windows 7 (64-bit) on Visual Studio 2010?

+4
source share
4 answers

The Maximus solution sounds like a spray and a prayer attempt.

I purely added only [opencvDir] \ include to my visual studio, and it all worked very well. Including syntax

 #include <opencv2/core/core.hpp> 

It works just fine, thatโ€™s how I do it. The rest of the steps I took were exactly what you described, except that I have different projects with different parallel opencv settings, so I did not add OpenCV to my global environment variable "PATH", but instead I selectively used OpenCV for each project by selecting project properties (right-click project, select properties) => Debugging => "Environment": set the value PATH = $ (SolutionDir) Dependencies \ opencv2.2 \ x86 \ bin "(in my case ) and the "merge environment" to "yes"

This is necessary so opencv finds its dll files if you link non-static.

Hope that helps :)

+2
source

You need two include directories. For me it was, C: \ OpenCV2.2 \ include and C: \ OpenCV2.2 \ include \ opencv

+1
source

Try to include all directories in C: \ opencv-2.2.0 \ modules \ module_name \ include For example, in your case it could be C: \ OpenCV-2.2.0 \ Modules \ kernel \ Include \ C: \ OpenCV-2.2 .0 \ modules \ imgproc \ Include \ and much more. You must use the comand line to get a list of directories in the C: \ opencv-2.2.0 \ modules. And after each addition to include. I do not know why this is happening.

0
source

On the properties page,
in C / C ++ -> Addictional Include Directory
I used "% OPENCV_DIR \ build \ include"
Replacing the real way fixed the problem with intellisense:
"C: \ opencv \ build \ include"

I am running opencv 2.4.2 and Visual Studio 2010 SP1.

0
source

All Articles