Problem with ofxOpenCv : 'opencv2/core/core_c.h' file not found

Hi, im trying openframeworks 0.8 . but im having problems with the opencv addon .
If i compile the ofxopencv example it runs ok, but when im trying to add ofxOpenCv to an existing proyect , it doesnt compile .

Im getting this error :

Lexical or Preprocessor issue

‘opencv2/core/core_c.h’ file not found

It seems its not recognizing the opencv2 folder , but the folder is there, any idea why is happening this and how to solve this?

thanks

A.

You to change your header search paths to include the libraries from OpenCV. In your IDE find the header search path tab and add the path of the libraries folder you are looking for.

For example:

In XCode.

Go to Build Settings -> Search Path.

then add the following path:

…/…/…/addons/ofxOpenCv/libs/opencv/include/opencv2/core

You’ll need to do this for all the OpenCV libraries that you are using.

Hi Rich, im still having problems on this. Ive tried what you said but its not working.
Im still getting the same error:

Lexical or Preprocessor Issue.
‘opencv2/core/core_c.h’ file not found

Ive tried adding as Header search paths also

…/…/…/addons/ofxOpenCv/libs/opencv/include/opencv2

and

…/…/…/addons/ofxOpenCv/libs/opencv/include/opencv

but its not working.

Do any idea have an idea of whats going on?

i made it work, i just needed to add all of this:

…/…/…/addons/ofxOpenCv/libs
…/…/…/addons/ofxOpenCv/libs/opencv
…/…/…/addons/ofxOpenCv/libs/opencv/include
…/…/…/addons/ofxOpenCv/libs/opencv/include/opencv
…/…/…/addons/ofxOpenCv/libs/opencv/include/opencv2

Just one last question related to this, when i try to compile without adding the correct paths it doesnt work but later when it doesnt allow me to fix the xcode project.
Everytime i want to acces building setup i get:

Document is not under source control.

the only way of fixing is opening a new file a and adding the correct paths.

any idea why do i get :
“Document is not under source control”

and how to solve this?

2 Likes

It may be easier to use the project generator, this will add all the paths you need to run the addons with little fuss.
Or you can also take a look at this

https://github.com/admsyn/ofplugin