Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'opencv2/opencv.hpp' file not found

Tags:

xcode

opencv

I successfully installed OpenCV on Mac OS X 10.8.2.

After that I configured Xcode 4.5.2 by following this guide by SSteve even that this guide was for Xcode 3.5.1 - everything was like it's suppose to be.

My openCV dylib's are in: /usr/lib

  1. Always Search User Paths: YES
  2. Framework Search Path: /usr/lib** (** stands for recursive search)
  3. Header Search Path: /usr/lib** (** stands for recursive search)

Full error message:

Lexical or Preprocessor Issue
'opencv2/opencv.hpp' file not found
like image 865
h4cky Avatar asked Dec 19 '12 13:12

h4cky


2 Answers

Header Search Path: /usr/lib** (** stands for recursive search)

It's definitely wrong. You should setup this path like:

/usr/local/include/opencv2**

or:

/usr/include/opencv2**

From your link:

In the Search Paths section set Header Search Paths to /usr/local/include (/opt/local/include if you used MacPorts)

like image 102
ArtemStorozhuk Avatar answered Sep 26 '22 10:09

ArtemStorozhuk


In my case, I wrote:

/usr/local/include/opencv4

Header Search Path. I used opencv4, so I needed to add search_path a little bit deeper

like image 34
iman kazemayni Avatar answered Sep 24 '22 10:09

iman kazemayni