14

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
h4cky
  • 899
  • 1
  • 13
  • 33

2 Answers2

10

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)

ArtemStorozhuk
  • 8,715
  • 4
  • 35
  • 53
  • I've solved this problem but other problems persist now, do you want to assist whit them ? :) Example:: '(something)' was not declared in this scope. – h4cky Dec 19 '12 at 14:06
  • 1
    @h4cky no, sorry. Try to search in Google: https://www.google.com.ua/search?q='DBL_EPSILON'+was+not+declared+in+this+scope&oq='DBL_EPSILON'+was+not+declared+in+this+scope&aqs=chrome.0.57.371&sugexp=chrome,mod=13&sourceid=chrome&ie=UTF-8 – ArtemStorozhuk Dec 19 '12 at 14:18
  • 1
    If you're having more problems, ask more questions. But do try a little research first. – SSteve Dec 19 '12 at 19:26
  • 1
    @ArtemStorozhuk Hi,i am using Xcode 4.6 i got same problem "Lexical or Preprocessor Issue'opencv2/opencv.hpp' file not found" i set the path what you mentioned, but still showing the same error......help me – Krish Allamraju Mar 27 '13 at 09:42
  • @krish did you found the problem ? – YasBES Feb 20 '14 at 21:21
  • This no longer works for 2021, and the original guide linked in the question isn't even available any more. – 0xTomato Dec 11 '21 at 18:39
2

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

iman kazemayni
  • 1,255
  • 1
  • 19
  • 20