It appears that the issue is that OpenSceneGraph is linked against libstdc++, 
while my application was being linked against libc++.

According to the documentation for libc++ ( http://libcxx.llvm.org ), the two 
are not ABI compatible, and with the amount of inline code used in 
OpenSceneGraph, it's not surprising that the two don't co-exist.

Linking my application against libstdc++ stopped it from crashing, which should 
solve the issue for now, but I'd really like to be using libc++ instead, 
because it brings C++11 compatibility as well as performance improvements.

So, what would it take to configure OpenSceneGraph's build environment to link 
against libc++, rather than libstdc++?

- Ron

On Nov 8, 2013, at 10:37 PM, Ronald Aldrich <[email protected]> wrote:

> Hello All,
> 
> I'm new to OpenSceneGraph, so please bear with me.
> 
> I'm attempting to write a Mac OS X native (cocoa) application that uses 
> OpenSceneGraph, and I'm having some difficulty.
> 
> I created an XCode project to build OpenSceneGraph as a set of frameworks 
> (Using CMake), and I think I was mostly successful at that.
> 
> Now, I'm trying to use those frameworks within my own application, and having 
> some difficulty.
> 
> I've created a class (OSGView) along the lines of the OSGViewerCocoa 
> OSGViewer class - simplified, and modified for ARC.  That class doesn't 
> populate the scene data, and when the application runs,  a view filled with 
> blue is displayed - so good, so far.
> 
> Next, I tried to create a triangle mesh to populate the scene data with, and 
> that's where my problem occurs - when one of the array objects I created is 
> deleted, the application crashes.
> 
> I can simplify the problem down to the following:
> 
> - (void) test
> {
>       osg::ref_ptr<osg::Vec3Array> theVertices = new osg::Vec3Array(0);
> }
> 
> When the Vec3Array is deleted, it crashes at the end of Object::~Object(), 
> with the code
> 
> Thread 1: EXC_BAD_ACCESS (code=1, address= 0xfffffffffffffff8)
> 
> I then thought I'd go back to basics, and build the OSGViewerCocoa example, 
> to see how it works, but when I build it, all I get is a unix executable 
> (OSGViewerCocoad), which doesn't run because it isn't assembled as a complete 
> Mac application.
> 
> I suspect that the problem I'm having is caused by a mix of build 
> environments - CMake for OpenSceneGraph, and XCode (LLVM) for my application, 
> but I've got no idea how to resolve that since CMake doesn't appear to be 
> able to create complete applications.
> 
> So, does anyone have a suggestion?
> 
> TIA,
> 
> Ron Aldrich
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to