[osg-users] Android osgPlugins

Christian Kehl christian-kehl at web.de
Wed Apr 29 05:23:53 PDT 2015


Hi,

So, what I tried now is to revert to the old OpenSceneGraph. I was looking up in the internet for the rand() error on the android platform, where people say <cstdlib> needs to be explicitly included in the header that uses the function. The stat64 error is an ample ifdef construct in OpenSceneGraph/src/osgDB/FileUtils.cpp. I tried to add there the following (osg svn version 3.3.3)


    #if defined(GL_VERSION_ES_CM_1_0) || defined(GL_VERSION_ES_CM_1_1) || defined(GL_VERSION_ES_2_0) || defined(GL_VERSION_ES_1_1) || defined(GL_VERSION_ES_1_0)
        // if we are on android,we need to obscure the 64-bit pointer (needs to be adapted for android >=r10c
        // due to 64 bit support)
        #define stat64 stat
    #endif

(line 93, after the switch for _DARWIN_FEATURE_64_BIT_INODE)

still, the work is unsuccessfull as I still get the same errors.

christian at PROMETHEUS:/media/christian/DATA/osgAndroid/org.openscenegraph.android$ ${ANDROID_NDK}/ndk-build
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIosgViewer.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIosg.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIosgDB.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIosgUtil.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIosgGA.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= JNIUtils.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= MultiViewNode.cpp
[armeabi] Compile++ thumb: jniosg-gles1 <= GLES2ShaderGenVisitor.cpp
[armeabi] SharedLibrary  : libjniosg-gles1.so
/home/christian/android-install/lib/osgPlugins-3.3.3/libosgdb_serializers_osgparticle.a(RadialShooter.cpp.o):RadialShooter.cpp:function osgParticle::range<float>::get_random() const: error: undefined reference to 'rand'
/home/christian/android-install/lib/osgPlugins-3.3.3/libosgdb_serializers_osgparticle.a(RadialShooter.cpp.o):RadialShooter.cpp:function osgParticle::RadialShooter::shoot(osgParticle::Particle*) const: error: undefined reference to 'rand'
/home/christian/android-install/lib/osgPlugins-3.3.3/libosgdb_serializers_osgparticle.a(RandomRateCounter.cpp.o):RandomRateCounter.cpp:function osgParticle::RandomRateCounter::numParticlesToCreate(double) const: error: undefined reference to 'rand'
/home/christian/android-install/lib/osgPlugins-3.3.3/libosgdb_serializers_osgparticle.a(SectorPlacer.cpp.o):SectorPlacer.cpp:function osgParticle::SectorPlacer::place(osgParticle::Particle*) const: error: undefined reference to 'rand'
/home/christian/android-install/lib/libosgDB.a(FileUtils.cpp.o):FileUtils.cpp:function osgDB::fileType(std::string const&): error: undefined reference to 'stat64'
/home/christian/android-install/lib/libosgDB.a(FileUtils.cpp.o):FileUtils.cpp:function osgDB::makeDirectory(std::string const&): error: undefined reference to 'stat64'
/home/christian/android-install/lib/libosgDB.a(FileUtils.cpp.o):FileUtils.cpp:function osgDB::makeDirectory(std::string const&): error: undefined reference to 'stat64'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libjniosg-gles1.so] Error 1


Thank you!

Cheers,
Christian

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








More information about the osg-users mailing list