Opencv - Can't find header files

2019-07-20 13:33发布

问题:

I'm trying to start development with opencv. The problem is, until now I coul barely setup the opencv cos I cant find its header files.

I made some research regarding to this subject but none of them were realy helpful, below some of the links:

  1. Where are the opencv2 include files?

  2. http://answers.opencv.org/question/14712/opencvhpp-not-in-opencv2/

I made the built the files using CMAKE GUI - Built the code with MVS 11 x64 both debug and release. The compilation suceeded and I cant found libs and dlls, but no headers at all anywhere.

Checkout the pics:

Opencv2 folder

Local folder

So, now I ask, What am I missing here?

Thanks for the help

EDIT ONE:

Is that what you meant?

EDIT TWO:

I found some headers inside the source of opencv, and each of them is inside an specific folder, like core, highgui and so on - that is it? or something still wrong? cos I thought I should take the headers on the build, no on the source..

回答1:

append "opencv/build/include" to your include path.

if you built the opencv libraries yourself using cmake, make sure you run the INSTALL project, and add the folder, where it installed to.

When you run make install then the include files that you need are copied to a single directory determined by the makefiles and probably displayed as a part of the output.



回答2:

I know what's going on. After built the entire solution, under the "opencv" solution strcutre, there is a folder called "CMakeTargets", expand this folder, you can see "INSTALL" project, and right-click this project, then select "build" option, then after installation, all libraries and head files will be located at the correct path. Like the following picture shows: here



回答3:

Take a look at the settings that were in use when you built OpenCV - the include path must point to where the include files are for your build to have succeeded.