Ask Your Question
0

openCV3.1.0 on Visual studio 2015 (community) install failed: cannot open include file

asked 2016-01-05 10:24:52 -0600

sofia123 gravatar image

updated 2016-01-05 11:12:08 -0600

I followed the exact tutorial on the website. Here is what I did for the installation:

Download and unzip the pre-compiled 3.1.0 package.

In the command window: setx -m OPENCV_DIR C:\opencv310\Build\x64\vc14

Add %OPENCV_DIR%\bin to path in the system variable.

After setting environment variable I followed the tutorial:

c/c++--additional include directories: $(OPENCV_DIR)....\include for both debug and release mode

linker--general--additional library directories: $(OPENCV_DIR)\lib for both debug and release mode

linker--input--additional dependencies: opencv_world310d.lib for debug mode; opencv_world310.lib for release mode

However,

include <opencv2\opencv.hpp>

gave an error saying no such file or directory. Can someone help me?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-01-05 11:25:00 -0600

berak gravatar image

updated 2016-01-05 11:29:52 -0600

your c++ 'additional include directories' should point to C:\opencv310\build\include (or to $(OPENCV_DIR)..\..\include if you prefer that, note the additional backslash !)

edit flag offensive delete link more

Comments

Hi, I am sorry for the typo. I did use $(OPENCV_DIR)..\..\include in the c++ additional include directories. I can't find anything else that goes wrong.

sofia123 gravatar imagesofia123 ( 2016-01-05 12:30:05 -0600 )edit

oh, sorry, if at all it's probably $(OPENCV_DIR)\..\..\include <- yet another backslach

berak gravatar imageberak ( 2016-01-05 12:35:42 -0600 )edit

No. $(OPENCV_DIR)\..\..\include does not work either. This is really frustrating. I guess I should use the source code and build using cmake.

sofia123 gravatar imagesofia123 ( 2016-01-06 12:12:15 -0600 )edit

For those who interested to know what happened: I reinstalled visual studio 2015 and it worked this time.

sofia123 gravatar imagesofia123 ( 2016-01-06 16:35:30 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-01-05 10:23:51 -0600

Seen: 2,146 times

Last updated: Jan 05 '16