Xcode Templates:

We have included a "New Project" template for OpenSceneGraph projects. We recommend you place the "OSG Application" folder into either:

/Library/Application Support/Apple/Developer Tools/Project Templates/Appllcation (for system-wide)
~/Library/Application Support/Apple/Developer Tools/Project Templates/Appllcation (for per-user)

After doing this, when doing a File->New Project, you will see "OSG Application" under the Application category. Selecting this will create a simple OSG project with some sample source code already in place which currently renders 2 colored tetrahedrons.

All the OSG related frameworks are listed already, though gdal and osgTerrain are not checked by default. To link against them, you must check their checkboxes to enable them. Feel free to uncheck or remove frameworks you don't need.

The OSGTemplate target defines __USE_OSX_AGL_IMPLEMENTATION__  as a Preprocessor macro already for you.

A prefix header file has been included which lists all the OSG headers. This will take some additional time to compile your first time. If you don't need all the headers, you may remove them as you see fit.

You are encouraged to setup a "Copy Files Build Phase" for your project to automatically bundle the OSG frameworks and PlugIns. (And of course, use the "Bundle Resources" to include your Resources. We did not set this up automatically for you because if you use the development frameworks, they can be several hundred megabytes.

To learn more about Framework bundling, a good demonstration video and sample project exists here:
http://rentzsch.com/cocoa/embeddedFrameworks

Do not use the -fvisibility=hidden flag unless you know what you're doing. In some cases, Xcode 2.2 seems to enable this by default in the project settings. You should verify your project settings and make sure this is disabled. Among other things, this flag will hide RTTI information causing dynamic_cast<> operations to fail. Since parts of OSG are dependent on RTTI, this option should remain off. The flag -fvisibility-inlines-hidden may be safe to use. (This is actually enabled in our Xcode projects. If there are problems, please let us know.)

Finally, there may still be issues with Zerolink. We defer to the default for this option and in current Xcode versions, the default is on. In the worst cases, scenes will not render correctly or the application may crash. The worst thing about this is that the problems are so strange, you may not realize Zerolink is the problem. To see this for yourself (we tried in Xcode 2.2), you might try comparing the osgdelaunay example with and without Zerolink, toggling through all values of 'n'. With Zerolink certain objects do not even appear and it crashes. So you are probably should disable this to be safe. However, for the daring, Zerolink does seem to work for some projects though we do not fully understand the criteria for this. Furthermore, Apple constantly works on improving this feature so maybe one day it will all just work right.