2

this is yet another OpenCV installation question, however I wasn't able to find an answer by reading answers to existing ones. I'm trying to set up OpenCV 2.3.1 directories in VS 2010 and migrate several of my projects to this new version from OpenCV 2.2. I followed this Setup OpenCV-2.3 for Visual Studio 2010 post, which is for 2.3 (2.3 and 2.3.1 apparently have the same folder structure), but it doesn't seem accurate.

First of all, if I download and extract OpenCV-2.3.0-win-superpack.exe (version from 2011-07-04 on sourceforge), there aren't build and opencv directories. Also, there aren't any precompiled libraries, I have to use CMake, create VS2010 solution and compile it from scratch.

Second, the three include directories

C:\OpenCV2.3\build\include\opencv
C:\OpenCV2.3\build\include\opencv2
C:\OpenCV2.3\include

do not contain all the necessary module headers. If I include

#include <opencv/cv.h>

or

#include <opencv2/opencv.hpp>

and try to build the project, I get C1083 for every module (core, imgproc, ...), as opencv.hpp has these lines

#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc/imgproc_c.h"
...

Indeed, the headers of each module are not in any of the three include directories above, they are in modules folder, deeply nested in complicated directory structure as modules\{module}\include\opencv2\{module}\{module}.hpp, so I have to add every include directory manually. This seems to work, but it is very time consuming especially when changing something and it gets very complicated when compiling Matlab MEX programs, because in Matlab there's no such thing as property sheets or simple management of include directories. I don't understand why it gets with each new version more and more difficult to properly configure OpenCV...

So, my question is: am I doing something wrong? Perhaps CMake configuration (I used all the defaults, compiler VS10 x64)? The documentation for newer versions of OpenCV is missing and the posts such as Setup OpenCV-2.3 for Visual Studio 2010 describe much simpler procedure and directory structure...

Community
  • 1
  • 1
buchtak
  • 107
  • 3
  • 7

1 Answers1

2

It sounds like you didn't build the INSTALL target in Visual Studio. Did you only build ALL_BUILD?

mevatron
  • 13,911
  • 4
  • 55
  • 72
  • This works, thanks. Yes, I only built `ALL_BUILD` target. Building `INSTALL` target solves the problem, however the `include`, `bin` and `lib` directories are now in `OpenCV\build\install` folder (I used default configuration in VS). – buchtak Nov 03 '11 at 10:15
  • If you want to change that, you'll need to change the install prefix when configuring the build with CMake. – mevatron Nov 03 '11 at 13:23