nathan wrote:
> Hi Jordi,
> 
> thanks for getting back to me. I did compile with OSG in static mode. Here 
> are the flags I'm using:
> 
> OSG_GLES2_VARS="-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"
> 
> OSG_ANDROID_VARS="-DDYNAMIC_OPENTHREADS=OFF 
> -DDYNAMIC_OPENSCENEGRAPH=OFF 
> -DOSG_BUILD_PLATFORM_ANDROID=ON 
> -DANDROID_ABI="armeabi armeabi-v7a" 
> -DANDROID_PLATFORM=7 
> -DANDROID_STL="gnustl_static" 
> -DANDROID_DEBUG=OFF 
> -DANDROID_NDK=${ANDROID_NDK_ROOT} 
> -DJ=12"
> 
> cmake ${OSG_ANDROID_VARS} ${OSG_GLES2_VARS} -DCMAKE_BUILD_TYPE=Release 
> -DCMAKE_INSTALL_PREFIX="${GLOBAL_OUTDIR}/osg-${VERSION}/${TOOLCHAIN}"
> 
> I wondered about that too, because OSG is searching for a dynamic library in 
> osgPlugins-3.2.1/ directories. I thought I didn't need to add this directory 
> with the plugins on to my device. As far as I can see I don't have an 
> osgPlugings directory produced by my OSG build for Android in the same way I 
> would for PC. Is this something I need to do? If so I would appreciate a link 
> to any instructions available.
> 
> Thanks,
> Nathan
> From:  [] on behalf of Jordi Torres []
> Sent: 09 January 2014 17:13
> To: OpenSceneGraph Users
> Subject: Re:  Android osgPlugins
> 
> 
> 
> Hi Nathan, 
> 
> Did you compile OSG in static mode as stated in the documentation?
> 
> 
> -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF 
> 
> 
> Right now is a must to compile in static mode. We have some tests with 
> dynamic libraries but compiling in dynamic mode involves too many changes and 
> we have still work to do to make it public. 
> 
> 
> Hope it helps. 
> 
> 
> 
> 2014/1/9 Nathan Collins < ()>
> 
> >    
> > Hi, 
> >   
> > I have compiled OSG for Android, and built and deployed the GLES2 Android 
> > example on my Nexus 4. However I’m having trouble loading cow.osg, or any 
> > other .osg/.osgt files, to test that it works. I’ve built OSG for Android 
> > in the past and had these models working but this time around I’m not able 
> > to load any models at all. I get the following warnings from logcat: 
> >   
> > 01-09 16:46:11.812: E/Osg Viewer(18327): There are 1 models to load 
> > 01-09 16:46:11.812: E/Osg Viewer(18327): Loading: 
> > /storage/emulated/0/cow.osgt 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): 
> > FindFileInPath(/storage/emulated/0/cow.osgt): returning 
> > /storage/emulated/0/cow.osgt 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/vendor/lib' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /vendor/lib/osgPlugins-3.2.1/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/system/lib' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /system/lib/osgPlugins-3.2.1/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/lib/' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /usr/lib/osgPlugins-3.2.1/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/local/lib/' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /usr/local/lib/osgPlugins-3.2.1/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/vendor/lib' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /vendor/lib/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/system/lib' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /system/lib/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/lib/' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /usr/lib/osgdb_osg.so ... 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): itr='/usr/local/lib/' 
> > 01-09 16:46:11.812: D/Osg Viewer(18327): FindFileInPath() : trying 
> > /usr/local/lib/osgdb_osg.so ... 
> > 01-09 16:46:11.812: I/Osg Viewer(18327): Warning: dynamic library 
> > 'osgPlugins-3.2.1/osgdb_osg.so' does not exist (or isn't readable): 
> > 01-09 16:46:11.812: I/Osg Viewer(18327): dlopen failed: library 
> > "osgPlugins-3.2.1/osgdb_osg.so" not found 
> > 01-09 16:46:11.812: I/Osg Viewer(18327): DynamicLibrary::failed loading 
> > "osgPlugins-3.2.1/osgdb_osg.so" 
> > 01-09 16:46:11.812: E/Osg Viewer(18327): Model not loaded 
> >   
> > Now I thought I didn’t have to do anything special last time to load an 
> > .osg file but I’m wondering what I’ve missed? My Android.mk file just has 
> > the standard set OSG_ANDROID_DIR and add path/to/libgnustl_static.a in 
> > LOCAL_LDLIBS modifications. I’m working with OSG branch 3.2 on Fedora, with 
> > ndk-r9c. 
> >   
> > Any help would be greatly appreciated. Thanks, 
> >   
> > Nathan 
> >   
> > Nathan Collins
> > Software Engineer
> > ________________________________
> > Have you downloaded your FREE copy of FieldMove Clino? 
> > Find out more about our app for iPhone and Android smartphones: 
> > http://news.mve.com/fieldmoveclino (http://news.mve.com/fieldmoveclino) 
> > Midland Valley Exploration Ltd.
> > 144 West George Street
> > Glasgow G2 2HG
> > United Kingdom 
> > Tel: +44 (0) 141 332 2681 (tel:%2B44%20%280%29%20141%20332%202681)
> > Fax: +44 (0) 141 332 6792 (tel:%2B44%20%280%29%20141%20332%206792) 
> > The structural geology experts  
> >   
> > 
> > 
> > _______________________________________________
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
>  
> 
> 
> 
> -- 
> Jordi Torres
> 
>  ------------------
> Post generated by Mail2Forum


Hi Nathan,

I don't have any problems with using GLES2 for Android. It is correct you don't 
have a osgPlugins directory in your build output. You should however have a 
static library (*.a) file for each of the libraries and plugins, e.g. 
libosgdb_osg.a to load .osg files. Can you verify you do have this file?
Also in your Android.mk file, make sure you link against it by adding 
"-losgdb_osg" to LOCAL_LDFLAGS, but if you are using the default 
AndroidExampleGLES2 files it should all be there.
Finally double check you are loading the plugin in the OsgMainApp.hpp by 
calling USE_OSGPLUGIN(osg).
I think since you are able to compile and link against the static libraries 
this is not of much help, but I'm not sure what else could be going wrong.

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





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

Reply via email to