Hi Julius, Seems that the ndk is not finding the libraries in the path.
Are the generated .a files in this path? -L/home/jus/working/osg/osg/build_gles1/lib Is OSG generated with armeabi?, I think the ndk sets the armeabi-v7 version by default, and osgAndroid is configured with armeabi in the Application.mk maybe that is giving some troubles. Rafa. 2014-11-13 16:45 GMT+01:00 Julius Haertl <[email protected]>: > Ok, the osg build works fine with the toolchain. > > Now I'm getting errors about missing osg libs, when building > org.openscenegraph.android. This seems strage to me, as the .so files are > in > /home/jus/working/osg/osg/build_gles1/lib/osgPlugins-3.3.3 and this path is > also setup to be used by the linker. > > You can find the complete output of the ndk-build here: > http://paste.cat/b2c707df > > Thanks so far, > Julius > > > On Thu, Nov 13, 2014 at 12:20:52PM +0100, Rafa Gaitan wrote: > > Hi Julius, > > > > I got the same problem, and I was unable to fix it with the current build > > system for android. Thats why I realized the submission with the changes > > for building with the ToolChain. I didn't change the examples to use this > > new build system but maybe you could you try to build OSG using my > > submissions and see if still happens, I'm using osgAndroid ( > > https://gitorious.org/osgandroid) and it works. > > > > In case you try to use the submission and osgAndroid, you need to copy > the > > libgnustl_static.a from the NDK > > > (android-ndk-r10c/sources/cxx-stl/gnu-libstdc++/4.9/libs/<target-platform>/) > > to the installed OSG_SDK/lib. > > > > If you find any problems building it, I'll try to fix it ASAP. > > > > Regards, > > Rafa. > > > > > > 2014-11-13 11:30 GMT+01:00 Julius Haertl <[email protected]>: > > > > > Hello, > > > > > > sorry for the bump, but I sill can't figure out, why I get this > compilation > > > errors. It would be realy nice if someone could take a look at it and > help > > > me > > > out. > > > > > > Thank you, > > > Julius > > > > > > On Thu, Nov 06, 2014 at 01:17:23AM +0100, Julius Haertl wrote: > > > > Hello , > > > > > > > > I'm trying to build OpenSceneGraph for Android and getting started > with > > > the > > > > osgViewer example application. After getting around the first errors, > > > I'm quite > > > > stuck with the following while building with ndk-build. > > > > ndk-build keeps complaining about missing reference of rand and > stat64. > > > > > > > > jus@tp-e130:~/workspace/osgViewer$ $ANDROID_NDK/ndk-build > > > > Android NDK: WARNING: APP_PLATFORM android-19 is larger than > > > android:minSdkVersion 8 in ./AndroidManifest.xml > > > > Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system > libraries > > > in linker flags: -lgnustl_static -losgdb_dds -losgdb_openflight > -losgdb_tga > > > -losgdb_rgb -losgdb_osgterrain -losgdb_osg -losgdb_ive > > > -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume > > > -losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain > > > -losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow > > > -losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx > > > -losgdb_deprecated_osganimation -losgdb_deprecated_osg > > > -losgdb_serializers_osgvolume -losgdb_serializers_osgtext > > > -losgdb_serializers_osgterrain -losgdb_serializers_osgsim > > > -losgdb_serializers_osgshadow -losgdb_serializers_osgparticle > > > -losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx > > > -losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer > > > -losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle > > > -losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg > > > -lOpenThreads /home/jus/workspace/osgViewer/obj/local/arm > > > > eabi-v7a/libgnustl_static.a > > > > Android NDK: This is likely to result in incorrect builds. Try > using > > > LOCAL_STATIC_LIBRARIES > > > > Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library > > > dependencies of the > > > > Android NDK: current module > > > > Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system > libraries > > > in linker flags: -lgnustl_static -losgdb_dds -losgdb_openflight > -losgdb_tga > > > -losgdb_rgb -losgdb_osgterrain -losgdb_osg -losgdb_ive > > > -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume > > > -losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain > > > -losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow > > > -losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx > > > -losgdb_deprecated_osganimation -losgdb_deprecated_osg > > > -losgdb_serializers_osgvolume -losgdb_serializers_osgtext > > > -losgdb_serializers_osgterrain -losgdb_serializers_osgsim > > > -losgdb_serializers_osgshadow -losgdb_serializers_osgparticle > > > -losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx > > > -losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer > > > -losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle > > > -losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg > > > -lOpenThreads /home/jus/workspace/osgViewer/obj/local/arm > > > > eabi-v7a/libgnustl_static.a > > > > Android NDK: This is likely to result in incorrect builds. Try > using > > > LOCAL_STATIC_LIBRARIES > > > > Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library > > > dependencies of the > > > > Android NDK: current module > > > > [armeabi] Compile++ thumb: osgNativeLib <= osgNativeLib.cpp > > > > [armeabi] Compile++ thumb: osgNativeLib <= OsgMainApp.cpp > > > > [armeabi] Compile++ thumb: osgNativeLib <= > OsgAndroidNotifyHandler.cpp > > > > [armeabi] SharedLibrary : libosgNativeLib.so > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgdb_deprecated_osgparticle.a(IO_SectorPlacer.o): > > > in function osgParticle::SectorPlacer::place(osgParticle::Particle*) > > > > const:/home/jus/Android/OpenSceneGraph-3.2.1/include/osgParticle/range:65: > > > error: undefined reference to 'rand' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgdb_deprecated_osgparticle.a(IO_SectorPlacer.o): > > > in function osgParticle::SectorPlacer::place(osgParticle::Particle*) > > > > const:/home/jus/Android/OpenSceneGraph-3.2.1/include/osgParticle/range:59: > > > error: undefined reference to 'rand' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgdb_deprecated_osgparticle.a(IO_RadialShooter.o): > > > in function osgParticle::range<float>::get_random() > > > > const:/home/jus/Android/OpenSceneGraph-3.2.1/include/osgParticle/range:59: > > > error: undefined reference to 'rand' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgdb_deprecated_osgparticle.a(IO_RadialShooter.o): > > > in function osgParticle::range<osg::Vec3f>::get_random() > > > > const:/home/jus/Android/OpenSceneGraph-3.2.1/include/osgParticle/range:59: > > > error: undefined reference to 'rand' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgDB.a(FileUtils.o): > > > in function osgDB::fileType(std::basic_string<char, > std::char_traits<char>, > > > std::allocator<char> > > > > > const&):/home/jus/Android/OpenSceneGraph-3.2.1/src/osgDB/FileUtils.cpp:306: > > > error: undefined reference to 'stat64' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgDB.a(FileUtils.o): > > > in function osgDB::makeDirectory(std::basic_string<char, > > > std::char_traits<char>, std::allocator<char> > > > > > const&):/home/jus/Android/OpenSceneGraph-3.2.1/src/osgDB/FileUtils.cpp:153: > > > error: undefined reference to 'stat64' > > > > > > > > /home/jus/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > > > > /home/jus/Android/OpenSceneGraph-3.2.1/osginstall/obj/local/armeabi/libosgDB.a(FileUtils.o): > > > in function osgDB::makeDirectory(std::basic_string<char, > > > std::char_traits<char>, std::allocator<char> > > > > > const&):/home/jus/Android/OpenSceneGraph-3.2.1/src/osgDB/FileUtils.cpp:176: > > > error: undefined reference to 'stat64' > > > > collect2: ld returned 1 exit status > > > > make: *** [obj/local/armeabi/libosgNativeLib.so] Error 1 > > > > > > > > > > > > I'm using OpenSceneGraph 3.2.1 with Android NDK r10c. > > > > I hope somebody can help me with this issue. > > > > > > > > Thanks, > > > > Julius > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > > > > > > > > > > -- > > Rafael Gaitán Linares > > CTO at Mirage Technologies S.L - http://www.mirage-tech.com > > > _______________________________________________ > > 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 > -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

