<div dir="ltr">Hello Christian, <div><br></div><div>Just to clarify a little bit the things:</div><div><br></div><div>- All the versions until 3.3.2 (I think that's the last one), should be compiled using the old system (generating the Android.mk files through cmake)</div><div><br></div><div>- Newer version must use the new Toolchain mechanism</div><div><br></div><div>Both methods are explained here: <a href="http://www.openscenegraph.org/index.php/documentation/platform-specifics/android">http://www.openscenegraph.org/index.php/documentation/platform-specifics/android</a></div><div><br></div><div>Regarding the examples inside OSG, I don't know the current status, as far as I know Jordi made them work but I usually use osgAndroid. FYI I changed the repository of osgAndroid to github, seems that gitorious has been absorbed by gitlab, so I moved it out. The new url is: <a href="https://github.com/corsario/osgAndroid">https://github.com/corsario/osgAndroid</a></div><div><br></div><div>Regarding the thirdparty dependencies with the new Toolchain, you are right, is something I forgot to add into cmake when I was cleaning it up for building for Android. I'll try to do it once I had some time.</div><div><br></div><div>On the other hand, you must build OSG either GLES1 or GLES2. If you build it against GLES2 then you need to add your own shaders to see something on screen, of course the example for GLES2 won't work if OSG was built with GLES1 and the GLES1 example won't show anything if OSG was compiled with GLES2, I apologize if this was already clarified :)</div><div><br></div><div>Best regards,</div><div>Rafa.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-22 21:59 GMT+02:00 Christian Kehl <span dir="ltr"><<a href="mailto:Christian.Kehl@uni.no" target="_blank">Christian.Kehl@uni.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Christian Kehl <Christian.Kehl@...> writes:<br>
<span class=""><br>
><br>
> Jordi Torres <jtorresfabra <at> ...> writes:<br>
><br>
> ><br>
> ><br>
> > Hi Christian, <br>
> > I just compiled OSG for Android and executed the example with the fresh<br>
> build for GLES1 without major problems. <br>
> > What version of OSG are you running? Does the example shipped with OSG<br>
> works for you? Are you compiling using the toolchain?<br>
> ><br>
> >  <br>
> ><br>
> ><br>
> ><br>
> > 2015-04-20 10:58 GMT+02:00 Jordi Torres<br>
</span>> <jtorresfabra@...>:<br>
<span class="">> > Hi Christian, Jan et al.<br>
> > Sorry for not being too active.... Anyway, did you try to compile all with<br>
> the last additions from Rafa Gaitán? Now it is possible to compile OSG for<br>
> Android with dynamic libraries, take a look<br>
><br>
to <a href="http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/178-building-openscenegraph-for-android-3-4" target="_blank">http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/178-building-openscenegraph-for-android-3-4</a><br>
> .<br>
> > Is a must for you to use static libs? You can try the dynamic version,<br>
> maybe it solves your problems.<br>
> ><br>
> > Also we are using osgAndroid ( <a href="https://gitorious.org/osgandroid/pages/Home" target="_blank">https://gitorious.org/osgandroid/pages/Home</a><br>
> ) maybe it could be helpful. <br>
> ><br>
> > I'm building now OSG for Android to do some testing. <br>
> ><br>
> > I hope I can help a bit later. <br>
> ><br>
> ><br>
> ><br>
> ><br>
> > Do the osgAndroid examples shipped with OSG work for you? If those don't<br>
> work neither, then something has changed in OSG and broke it since mid-2013<br>
> when I have last compiled the Android version (and when it was working).<br>
> ><br>
> > J.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
><br>
> Hi to everybody,<br>
><br>
> it's comforting to see some activity going on. The last days, I was working<br>
> on another project, so please excuse my late reply too.<br>
><br>
> I am using OpenSceneGraph 3.0.1. The GLES1 and GLES2 example shipped with<br>
> android are the ones that break (not load data). It's not a must-have for me<br>
> to use static linking - if dynamic linking would work, it would be fine for<br>
> me too. At the moment, I just like to see some model on my android<br>
><br>
</span><span class="">> I will try out osgAndroid and the 3.0.4 build - let's hope it resolves the<br>
> issue. Jordi - which version of the NDK are you using ? I have the r10 NDK<br>
> installed. It may be good to know for tracking down the error.<br>
><br>
> News are about to be reported soon. Best Regards,<br>
><br>
> Christian<br>
><br>
> _______________________________________________<br>
> osg-users mailing list<br>
</span>> osg-users <at> <a href="http://lists.openscenegraph.org" target="_blank">lists.openscenegraph.org</a><br>
> <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
><br>
<br>
So, I downloaded the 3.3.7 developer version of OpenSceneGraph and ran the<br>
cmake command as given in the link for "Building OpenSceneGraph 3.3.2-3.4.x<br>
for Android" (sth. like it).<br>
<br>
After a bit of hassle, it compiled fine.<br>
I also put the 3rdParty folder inside the OSG root folder, but cmake reported<br>
that CURL, Jpeg, Tiff etc. are missing - well, weird, but not urgent for now.<br>
I use the svn version rc2, and compile with OPENGL_PROFILE "GLES2".<br>
<br>
Then, I imported the GLES1/2 examples in Eclipse, modified the Android.mk so<br>
to link to the installation folder (btw: still used static libs) and using<br>
gnustl_static, ran ndk-build, and this is the output:<br>
<br>
christian@PROMETHEUS:~/workspace/Android/osgViewerGLES1_337$<br>
<div><div class="h5">${ANDROID_NDK}/ndk-build<br>
Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system libraries<br>
in linker flags:<br>
-lgnustl_static -lcurl -ljpeg -lgif -lpng -ltiff -losgdb_dds<br>
-losgdb_openflight -losgdb_tga -losgdb_rgb -losgdb_osgterrain -losgdb_osg<br>
-losgdb_ive -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume<br>
-losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain<br>
-losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow<br>
-losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx<br>
-losgdb_deprecated_osganimation -losgdb_deprecated_osg<br>
-losgdb_serializers_osgvolume -losgdb_serializers_osgtext<br>
-losgdb_serializers_osgterrain -losgdb_serializers_osgsim<br>
-losgdb_serializers_osgshadow -losgdb_serializers_osgparticle<br>
-losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx<br>
-losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer<br>
-losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle<br>
-losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg<br>
-lOpenThreads<br>
Android NDK:     This is likely to result in incorrect builds. Try using<br>
LOCAL_STATIC_LIBRARIES<br>
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library<br>
dependencies of the<br>
Android NDK:     current module<br>
Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system libraries in<br>
linker flags: -lgnustl_static -lcurl -ljpeg -lgif -lpng -ltiff -losgdb_dds<br>
-losgdb_openflight -losgdb_tga -losgdb_rgb -losgdb_osgterrain -losgdb_osg<br>
-losgdb_ive -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume<br>
-losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain<br>
-losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow<br>
-losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx<br>
-losgdb_deprecated_osganimation -losgdb_deprecated_osg<br>
-losgdb_serializers_osgvolume -losgdb_serializers_osgtext<br>
-losgdb_serializers_osgterrain -losgdb_serializers_osgsim<br>
-losgdb_serializers_osgshadow -losgdb_serializers_osgparticle<br>
-losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx<br>
-losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer<br>
-losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle<br>
-losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg<br>
-lOpenThreads<br>
Android NDK:     This is likely to result in incorrect builds. Try using<br>
LOCAL_STATIC_LIBRARIES<br>
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library<br>
dependencies of the<br>
Android NDK:     current module<br>
[armeabi] Compile++ thumb: osgNativeLib <= osgNativeLib.cpp<br>
[armeabi] Compile++ thumb: osgNativeLib <= OsgMainApp.cpp<br>
[armeabi] Compile++ thumb: osgNativeLib <= OsgAndroidNotifyHandler.cpp<br>
[armeabi] SharedLibrary  : libosgNativeLib.so<br>
</div></div>jni/OsgMainApp.cpp:101: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:102: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:103: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:104: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
collect2: error: ld returned 1 exit status<br>
make: *** [obj/local/armeabi/libosgNativeLib.so] Error 1<br>
<br>
Hence, the static linker does not find the function<br>
osgViewer::View::addEventHandler(...) in the library. This is the GLES1<br>
example. I guess it is no surprise it doesn't find THAT (shouldn't it be<br>
osgViewer::Viewer::addEventHandler ?!), rather the question is where this is<br>
coded ? I assume there must be sth. going on in the DOTOSGWRAPPER of<br>
osgViewer ...<br>
<br>
The output for the osgViewerGLES2, configured and setup the same way, looks<br>
as follows:<br>
<br>
christian@PROMETHEUS:~/workspace/Android/osgViewer_337$<br>
<div><div class="h5">${ANDROID_NDK}/ndk-build<br>
Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system libraries in<br>
linker flags: -lgnustl_static -lcurl -ljpeg -lgif -lpng -ltiff -losgdb_dds<br>
-losgdb_openflight -losgdb_tga -losgdb_rgb -losgdb_osgterrain -losgdb_osg<br>
-losgdb_ive -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume<br>
-losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain<br>
-losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow<br>
-losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx<br>
-losgdb_deprecated_osganimation -losgdb_deprecated_osg<br>
-losgdb_serializers_osgvolume -losgdb_serializers_osgtext<br>
-losgdb_serializers_osgterrain -losgdb_serializers_osgsim<br>
-losgdb_serializers_osgshadow -losgdb_serializers_osgparticle<br>
-losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx<br>
-losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer<br>
-losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle<br>
-losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg<br>
-lOpenThreads<br>
Android NDK:     This is likely to result in incorrect builds. Try using<br>
LOCAL_STATIC_LIBRARIES<br>
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library<br>
dependencies of the<br>
Android NDK:     current module<br>
Android NDK: WARNING:jni/Android.mk:osgNativeLib: non-system libraries in<br>
linker flags: -lgnustl_static -lcurl -ljpeg -lgif -lpng -ltiff -losgdb_dds<br>
-losgdb_openflight -losgdb_tga -losgdb_rgb -losgdb_osgterrain -losgdb_osg<br>
-losgdb_ive -losgdb_deprecated_osgviewer -losgdb_deprecated_osgvolume<br>
-losgdb_deprecated_osgtext -losgdb_deprecated_osgterrain<br>
-losgdb_deprecated_osgsim -losgdb_deprecated_osgshadow<br>
-losgdb_deprecated_osgparticle -losgdb_deprecated_osgfx<br>
-losgdb_deprecated_osganimation -losgdb_deprecated_osg<br>
-losgdb_serializers_osgvolume -losgdb_serializers_osgtext<br>
-losgdb_serializers_osgterrain -losgdb_serializers_osgsim<br>
-losgdb_serializers_osgshadow -losgdb_serializers_osgparticle<br>
-losgdb_serializers_osgmanipulator -losgdb_serializers_osgfx<br>
-losgdb_serializers_osganimation -losgdb_serializers_osg -losgViewer<br>
-losgVolume -losgTerrain -losgText -losgShadow -losgSim -losgParticle<br>
-losgManipulator -losgGA -losgFX -losgDB -losgAnimation -losgUtil -losg<br>
-lOpenThreads<br>
Android NDK:     This is likely to result in incorrect builds. Try using<br>
LOCAL_STATIC_LIBRARIES<br>
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library<br>
dependencies of the<br>
Android NDK:     current module<br>
[armeabi] Compile++ thumb: osgNativeLib <= osgNativeLib.cpp<br>
[armeabi] Compile++ thumb: osgNativeLib <= OsgMainApp.cpp<br>
[armeabi] Compile++ thumb: osgNativeLib <= OsgAndroidNotifyHandler.cpp<br>
[armeabi] SharedLibrary  : libosgNativeLib.so<br>
</div></div>jni/OsgMainApp.cpp:113: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:114: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:115: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
jni/OsgMainApp.cpp:116: error: undefined reference to<br>
'osgViewer::View::addEventHandler(osgGA::EventHandler*)'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:555: error:<br>
undefined reference to 'glColor4f'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:646: error:<br>
undefined reference to 'glEnableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:651: error:<br>
undefined reference to 'glVertexPointer'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:859: error:<br>
undefined reference to 'glDisableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:1062: error:<br>
undefined reference to 'glEnableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:1066: error:<br>
undefined reference to 'glTexCoordPointer'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:828: error:<br>
undefined reference to 'glEnableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:833: error:<br>
undefined reference to 'glColorPointer'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:565: error:<br>
undefined reference to 'glNormal3f'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:737: error:<br>
undefined reference to 'glEnableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:742: error:<br>
undefined reference to 'glNormalPointer'<br>
/media/christian/DATA/OpenSceneGraph301/include/osg/State:859: error:<br>
undefined reference to 'glDisableClientState'<br>
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:231:<br>
error: undefined reference to 'glColor4f'<br>
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:232:<br>
error: undefined reference to 'glPushMatrix'<br>
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:233:<br>
error: undefined reference to 'glTranslatef'<br>
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:238:<br>
error: undefined reference to 'glMultMatrixf'<br>
/media/christian/DATA/OpenSceneGraph301/src/osgParticle/Particle.cpp:244:<br>
error: undefined reference to 'glPopMatrix'<br>
[...]<br>
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:29:<br>
error: undefined reference to 'glColor4f'<br>
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:25:<br>
error: undefined reference to 'glColor4ub'<br>
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:34:<br>
error: undefined reference to 'glNormal3f'<br>
/media/christian/DATA/OpenSceneGraph301/src/osg/ArrayDispatchers.cpp:33:<br>
error: undefined reference to 'glNormal3f'<br>
collect2: error: ld returned 1 exit status<br>
make: *** [obj/local/armeabi/libosgNativeLib.so] Error 1<br>
<br>
Also there, it doesn't find the osgViewer::View::add..., but he also looks<br>
for the GLES1 fixed functionality pipeline calls that surely don't exist.<br>
The question for the is rather why the GLES2 example (I swear by god, it is<br>
the GLES2 example), asks for GLES1 functions ?!<br>
<br>
This is how far I got today. Any help would be highly appreciated. I also<br>
append my cmake-line.<br>
<br>
cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF<br>
-DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF<br>
-DOSG_GL_MATRICES_AVAILABLE=OFF -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF<br>
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF<br>
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF<br>
<span class="">-DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF<br>
-DOSG_GLES1_AVAILABLE=OFF -DOSG_GLES2_AVAILABLE=ON<br>
</span>-DCMAKE_INSTALL_PREFIX=$HOME/android_install -DCMAKE_BUILD_TYPE=Release<br>
-DCMAKE_TOOLCHAIN_FILE=/media/christian/DATA/OpenSceneGraph337<br>
/PlatformSpecifics/Android/android.toolchain.cmake<br>
-DOPENGL_PROFILE="GLES2"<br>
<br>
Tomorrow, I go and try the osgAndroid repo out.<br>
<br>
Best Regards already,<br>
<div class="HOEnZb"><div class="h5"><br>
Christian<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Rafael Gaitán Linares<br>CTO at Mirage Technologies S.L - <a href="http://www.mirage-tech.com" target="_blank">http://www.mirage-tech.com</a><br></div></div>
</div>