0
votes

When i compile this programme:

#include < C:\opencv\include\opencv\cv.h>

#include < C:\opencv\include\opencv\highgui.h>

Comes out this error:

C:\opencv\include\opencv\cv.h:63:33: fatal error: opencv2/core/core_c.h: No such file or directory

What do I have to do??

3

3 Answers

1
votes

The problem comes from using absolute paths to the headers. You have to add the directories where the header files of opencv reside to your linker. From your question I suppose they are:

C:\opencv\include\opencv\ and C:\opencv\include\

In eclipse you can add them through you project properties under C/C++ Build settings. Find where it says about include directories and put these two. Also you have to define the library directories and the libraries to be linked, if you haven't done this already.

Last but important, don't use absolute paths with include but relative.

#include "cv.h"

#include "highgui.h"

1
votes

Unfortunately, the path for the opencv2 in include have been changed. I solved this error including all necessary folders manually:

  1. Choose your opencv project on the left side located at Project Explorer.
  2. Click right click on selected project.
  3. Select Properties.
  4. Select C/C++ Build -> Settings -> Cross G++ Compiler -> Includes.
  5. In INCLUDE PATHS (-I) on the right side add path.
  6. The path is <PATH_TO_OPENCV>/modules/highgui/include.
  7. Do the same for other folders too.
0
votes

point your includes at opencv\build\include instead of opencv\include

(the former folder includes the modules, too, the latter does not, you have to add all those entries manually)