Hi,
This problem is still present.
It seems that under MacOS OpenSceneGraph can only be built with the llvm
compilers due to the Objective C portions of code. I tried configuring gcc to
compile Objective C but there appear to be some differences between the Apple
compiler and gcc with respect to Objective C.
What I would like to do is be able to compile my application using gcc and then
link to OpenSceneGraph - I don't really care whether OpenSceneGraph is built
with gcc or llvm.
However, if I do build my application using gcc then it crashes. The code
segment can be boiled down to the following:
Code:
int main( int argc, char **argv )
{
fprintf(stderr, "Creating\n");
osg::ref_ptr<osg::DrawElementsUShort> p = new osg::DrawElementsUShort();
fprintf(stderr, "Created\n");
}
Compiled as follows:
Code:
/opt/local/bin/gcc-mp-4.8 -o osgtest osgtest.cpp -L /usr/local/lib -losg
-lOpenThreads -lstdc++ -I /usr/local/include/
And the crash is as follows:
Code:
Tobiass-retina-MacBook:trunk tobiasduckworth$ ./osgtest
Creating
Created
osgtest(52671) malloc: *** error for object 0x10c7b87e0: pointer being freed
was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
Tobiass-retina-MacBook:trunk tobiasduckworth$
This problem has been present for an age, and is forcing me to use the Apple
compilers to build my application, whereas I wish to use gcc.
Has anyone else out there experienced this problem? or have a solution to it
please?
I would really like to be able to build my application with gcc, but due to
this problem cannot.
...
Thank you!
Cheers,
Tobias[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48768#48768
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org