[osg-users] [build] osg + qt + android = linker problem

Robert Gosztyla robert.gosztyla at gmail.com
Wed Apr 29 03:36:58 PDT 2015


Hi,

I'm using 3.2.2-rc2, building it for Android and trying to use in Qt (5.4.1) application. OSG is configured with this:

cmake -DOSG_BUILD_PLATFORM_ANDROID=ON -DANDROID_NDK=/home/some/android/android-ndk-r10d -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=OFF -DOSG_GLES2_AVAILABLE=ON -DOSG_GL_LIBRARY_STATIC=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=OFF -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF -DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DJ=8 -DCMAKE_INSTALL_PREFIX="/some/sources/OpenSceneGraph-3.2.2-rc2/build" -DOPENGL_INCLUDE_DIR="/home/some/android/android-ndk-r10d/platforms/android-21/arch-arm/usr/include/GLES"

Seems, that sets of *.a libs are build, both for armeabi and armeabi-v7a without any problem. Trying to link them in qt application (from *.pro file):

LIBS += -L"/home/some/sources/OpenSceneGraph-3.2.2-rc2/build/obj/local/armeabi-v7a" -losg -losgUtil -losgDB -losgGA -losgViewer -lOpenThreads

gives me lots of linker errors, looks like osg libraries are not taken for link:

/home/some/sources/OpenSceneGraph-3.2.2-rc2/src/osgDB/Registry.cpp:752: error: undefined reference to 'osgGetVersion'
/home/some/sources/OpenSceneGraph-3.2.2-rc2/src/osgDB/Registry.cpp:225: error: undefined reference to 'osg::KdTreeBuilder::KdTreeBuilder()'
/home/some/sources/OpenSceneGraph-3.2.2-rc2/src/osgDB/OutputStream.cpp:669: error: undefined reference to 'osgGetVersion'
/home/some/sources/OpenSceneGraph-3.2.2-rc2/include/osg/Object:98: error: undefined reference to 'typeinfo for osg::ImageStream'
and so on...

Maybe some other osg version should be used for Android? Or something wrong is with cmake configuration? Whole build is done on Ubuntu x64.

Thank you!

Cheers,
Robert

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63566#63566








More information about the osg-users mailing list