user813853
user813853

Reputation:

"Include can't be found", how to fix it?

I am developing using OpenSceneGraph. I installed it from a user-runnable installer.

When I try to compile an application using OpenSceneGraph, I have this error :

Lexical or preprocessor error : Include cannot be found for all <osg/*> includes like <osg/AnimationPath>.

The file is available here /Library/Frameworks/osg.framework/Versions/92/Headers/XXXX So following this solution on how to "add existing frameworks" to the new Xcode, I added osg.framework to the project.

enter image description here

any idea is a welcome.

I am using :

Upvotes: 0

Views: 353

Answers (2)

user813853
user813853

Reputation:

You'll need to add /Library/Frameworks to the "Frameworks search path" in the project settings.

Upvotes: 0

Ivaylo Strandjev
Ivaylo Strandjev

Reputation: 70949

When compiling you will have to add the include files using the -I option of the compiler and also possibly add library directory using the -L option of the compiler(the options may be a bit different if you are using compiler different from gcc).

I guess both library and the include directories for this product should be subdirectories of the install destination you have chosen. For the include directory of course look for directories containing some kind of header files .h or .hpp and for the libraries look for .lib or .dll doesn't the library documentation mention what includes and libraries you need and where you can find them?

EDIT: you will also have to tell xcode where to search for your includes. I tried googling it and here is one of many results on how to add a directory to the include path of a project.

You will have to located which directory to add to the include path. It seems they set some environment variables in the official documentation for that.

Hope this helps.

Upvotes: 1

Related Questions