OpenCV3 build from Github

asked 2014-10-09 13:25:20 -0500

Doombot gravatar image

updated 2014-10-09 14:37:22 -0500

I built OpenCV 3 on Windows for Visual Studio 2012 Pro from Itseez Github. Now I am having issues with my includes. I noticed the structure of OpenCV3's directory is different from 2.4.X.

I created a property page and added the includes specified in the official tutorial . Of course a payed attention to use the correct path in relation to where stuff is on my computer.

Still, Visual Studio could not find the includes (it worked with OpenCV 2.4.9). I modified the includes to specify the subfolders such as in
#include <core\include\opencv2\core.hpp>
instead of simply
#include <opencv2\core.hpp>

Now IntelliSense removed the error from the include section but all the objects I instantiate are underlined in red, and Visual Studio cannot find identifiers such as "imread", etc. Other errors are of the kind: "cannot open source file "opencv2/core/version.hpp"" etc.

So, maybe I have simply made a mistake or a typo somewhere, or is it that the official tutorial doesn't work with OpenCV 3 due to the change in the core-module architecture?

Edit: Actually, I realize that I am unsure the compilation went that well. It seems like my "include" folder is not ok. Here is the path :
D:\OpenCV3\Build\include

and what the folder looks like:

image description

edit retag flag offensive close merge delete

Comments

please do not try such hacks as your include path above, as they only shadow a deeper problem with your environment (and make your code un-portable)

again, if #include <opencv2\core.hpp> does not work, your 'additional includes path' is not setup correctly, it should point to your_opencv/build/include, or your_opencv/build/install/include.

berak gravatar imageberak ( 2014-10-09 13:46:38 -0500 )edit

I wonder if there is a tutorial explicitly made to setup OpenCV3 in Visual Studio, without environment variables so I could see exactly every time what is the correct path for every includes. In the tutorial, they use an environment variable but it obscures what is the real path to enter (by real path, I mean the path "inside" OpenCV's installation folder.)

Doombot gravatar imageDoombot ( 2014-10-09 14:01:49 -0500 )edit
Doombot gravatar imageDoombot ( 2014-10-09 14:43:06 -0500 )edit

Turned out I did not follow correctly the compilation steps and forgot to compile the INSTALL from CMakeTargets

Doombot gravatar imageDoombot ( 2014-10-09 14:53:19 -0500 )edit

Hi, i'm facing the same issue, however i'm on a mac, and there is no INSTALL project that gets generated in my opencv folder. What alternate steps should i follow on the mac? Or should i also have had the INSTALL project to compile if things had gone correctly? (i just ran cmake and make)

sachi gravatar imagesachi ( 2016-03-03 08:58:39 -0500 )edit