0

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 :

  • IDE Xcode 4.5
  • Clang 4.1
  • OS X Mountain Lion
Community
  • 1
  • 1

2 Answers2

1

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.

Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
  • which compiler are you using? – Ivaylo Strandjev Jan 11 '13 at 13:30
  • clang 4.1 but I am not yet compiling still configuring to use OpenSceneGraph –  Jan 11 '13 at 13:31
  • I added **osg framework** to the xcode project but nothing happened. –  Jan 11 '13 at 13:46
  • I think you need to make use of `OSG_FILE_PATH` as I understand it. Could you explore this directory and try to figure out which should be the directory you need to add to your include path? – Ivaylo Strandjev Jan 11 '13 at 13:50
  • I updated my question , the file is part of **osg.framework** I included the framework but still ... :( –  Jan 11 '13 at 13:53
  • About `OSG_FILE_PATH` this variable is supposed to point to `Data` and images provided by the developers team of OpenSceneGraph. –  Jan 11 '13 at 13:55
0

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