Hi Stephan

here the answer of my workmate:

I tried this without luck. After compiling the Frameworks and using them in my application, I get the following linking errors when building with Xcode:

Undefined symbols:
"non-virtual thunk to osgViewer::Viewer::~Viewer()"
"osgDB::readImageFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, osgDB::Options const*)" "osgText::readFontFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, osgDB::Options const*)"
"osgViewer::Viewer::checkNeedToDoFrame()"
"non-virtual thunk to osgViewer::Viewer::setStartTick(unsigned long long)"
"non-virtual thunk to osgViewer::Viewer::setSceneData(osg::Node*)"

(See complete compiler output attached)

The same also happens when using the pre-compiled binaries from http://www.cuboslocos.com

You can use a similar technique with the dylibs created by the
cmake-build, but you'll have to adjust the paths via install_name_tool.

Also tried that. Compiled the dylibs with cmake and installed them in /usr/local/lib. Compiling and linking against them works fine. For packaging I copied them to the application bundle (to Contents/MacOS/) and changed all paths using install_name_tool. Starting the application does not show any linking errors but the following runtime error occurs:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)

Thread 0 Crashed:
0   libosg.61.dylib      0x0036bda5 osg::Node::getOrCreateStateSet() + 21
1   ....

When starting the application with the default references to /usr/local/lib/libosg* there are no such runtime errors.

Or you create an installer package which copies the dylibs / frameworks
to known places like /Library/Frameworks or /usr/lib

This is currently not an option :-(

~Thomas

Stephan Maximilian Huber schrieb:
Dominic Stalder schrieb:
we are trying to deploy an OSG application on Mac OS X to another
system, where OSG is not installed.

What is the best way to distribute the application, should we use static
OSG linking (makes the file huge) or are there other / better ways?

I haven't tried static builds on OS X, so I can't comment on them.

If you are using the deprecated xcode-projects to build osg as
frameworks you can embed them into your application bundle and
distribute it. This gives you a double-clickable app qhich you can copy
wherever you want, no installation-step necessary.

You just add a new copy-phase into your xcode-project of your app, set
it's target to Frameworks and add all osg-related frameworks to it. (and
the plugins goes into a subfolder plugins of the bundle)

You can use a similar technique with the dylibs created by the
cmake-build, but you'll have to adjust the paths via install_name_tool.

Or you create an installer package which copies the dylibs / frameworks
to known places like /Library/Frameworks or /usr/lib


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


    cd /Volumes/data/myosgproject
    /Developer/usr/bin/g++-4.0 -arch i386 
-L/Volumes/data/myosgproject/build/Release -L/Library/Frameworks 
-L/System/Library/Frameworks -F/Volumes/data/myosgproject/build/Release 
-filelist 
/Volumes/data/myosgproject/tmp/obj/wiitetris.build/Release/wiitetris.build/Objects-normal/i386/wiitetris.LinkFileList
 -mmacosx-version-min=10.3 -headerpad_max_install_names -L/Library/Frameworks 
-F/Library/Frameworks -lz -lm -framework IOBluetooth -framework OpenThreads 
-framework osg -framework osgViewer -framework osgText -framework osgGA 
-framework osgDB -framework osgUtil -framework QtSvg -framework QtSql 
-framework QtOpenGL -framework QtGui -framework Carbon -framework AppKit 
-framework QtCore -framework ApplicationServices -framework OpenGL -framework 
AGL -o 
/Volumes/data/myosgproject/build/Release/wiitetris.app/Contents/MacOS/wiitetris
Undefined symbols:
  "non-virtual thunk to osgViewer::Viewer::~Viewer()", referenced from:
      construction vtable for osgViewer::Viewer-in-QwtGLWidgetin 
moc_qwtglwidget.o
  "non-virtual thunk to osgViewer::Viewer::~Viewer()", referenced from:
      construction vtable for osgViewer::Viewer-in-QwtGLWidgetin 
moc_qwtglwidget.o
  "osgDB::readImageFile(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, osgDB::Options const*)", referenced from:
      osgDB::readImageFile(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&)in gameview.o
  "osgText::readFontFile(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, osgDB::Options const*)", referenced from:
      OsgOverlay::OsgOverlay()in osgoverlay.o
  "osgViewer::Viewer::checkNeedToDoFrame()", referenced from:
      construction vtable for osgViewer::Viewer-in-QwtGLWidgetin 
moc_qwtglwidget.o
      vtable for QwtGLWidgetin moc_qwtglwidget.o
  "non-virtual thunk to osgViewer::Viewer::setStartTick(unsigned long long)", 
referenced from:
      construction vtable for osgViewer::Viewer-in-QwtGLWidgetin 
moc_qwtglwidget.o
      vtable for QwtGLWidgetin moc_qwtglwidget.o
  "osgDB::readNodeFile(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&, osgDB::Options const*)", referenced from:
      osgDB::readNodeFile(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > const&)in tetrisblockview.o
  "non-virtual thunk to osgViewer::Viewer::setSceneData(osg::Node*)", 
referenced from:
      construction vtable for osgViewer::Viewer-in-QwtGLWidgetin 
moc_qwtglwidget.o
      vtable for QwtGLWidgetin moc_qwtglwidget.o
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to