OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

OpenSceneGraph static linking for Android [fixed]


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build]
View previous topic :: View next topic  
Author Message
tanshihaj
Newbie


Joined: 11 Aug 2017
Posts: 7

PostPosted: Sun Aug 13, 2017 10:09 pm    Post subject:
OpenSceneGraph static linking for Android [fixed]
Reply with quote

Hi,

I'm trying to compile static OpenSceneGraph for Android. However, when I'm trying to open simple .osg model, osg says that it can't load osgPlugins-3.4.0/osgdb_osg.so.

Host OS: macOS 10.12.6

CMake version 3.9.0

OpenSceneGraph version 3.4.0

Android NDK version r14b

CMake configuration:

Code:

cmake ../OpenSceneGraph \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX=../OpenSceneGraph-android-static \
-DCMAKE_SYSTEM_NAME="Android" \
-DCMAKE_SYSTEM_VERSION=17 \
-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a \
-DCMAKE_ANDROID_NDK=/Users/kamil/Library/Android/sdk/ndk-bundle \
-DOPENGL_PROFILE="GLES2" \
-DDYNAMIC_OPENTHREADS=OFF \
-DDYNAMIC_OPENSCENEGRAPH=OFF


I'm linking OpenSceneGraph libraries to my project qmake file as follows:

my-project.pro:
Code:

...
LIBS += $${OPENSCENEGRAPHPATH}/lib/osgPlugins-3.4.0/libosgdb_osg.a \
$${OPENSCENEGRAPHPATH}/lib/libosgViewer.a \
$${OPENSCENEGRAPHPATH}/lib/libosgDB.a \
$${OPENSCENEGRAPHPATH}/lib/libosgGA.a \
$${OPENSCENEGRAPHPATH}/lib/libosgText.a \
$${OPENSCENEGRAPHPATH}/lib/libosgUtil.a \
$${OPENSCENEGRAPHPATH}/lib/libosgShadow.a \
$${OPENSCENEGRAPHPATH}/lib/libosgTerrain.a \
$${OPENSCENEGRAPHPATH}/lib/libosgSim.a \
$${OPENSCENEGRAPHPATH}/lib/libosg.a \
$${OPENSCENEGRAPHPATH}/lib/libOpenThreads.a

INCLUDEPATH += $${OPENSCENEGRAPHPATH}/include

LIBS += $${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libcurl.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libgdal.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libft2.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libgif.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libjpeg.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libpng.a \
$${OPENSCENEGRAPHPATH}/obj/local/armeabi-v7a/libtiff.a
...


In my main.cpp I've used USE_OSGPLUGIN macro to link osg plugin:

main.cpp:

Code:

#include <osgDB/Registry>
...
USE_OSGPLUGIN(osg)
...
int main() {
...
}


However, when I'm trying to open some osg file:
Code:

osg::Node * node = osgDB::readNodeFile(":/resources/cessna.osg");


osgDB::readNodeFile returns NULL and prints in output:
Code:

Warning: dynamic library 'osgPlugins-3.4.0/osgdb_osg.so' does not exist (or isn't readable):
dlopen failed: library "osgPlugins-3.4.0/osgdb_osg.so" not found
DynamicLibrary::failed loading "osgPlugins-3.4.0/osgdb_osg.so"


What should I do to correctly link OpenSceneGraph library for Android?
Thank you!

Cheers,
Kamil


Last edited by tanshihaj on Thu Sep 21, 2017 12:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
tanshihaj
Newbie


Joined: 11 Aug 2017
Posts: 7

PostPosted: Thu Sep 21, 2017 12:58 pm    Post subject:
Reply with quote

Nevermind, I've already fix this problem.

Cheers,
Kamil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How to generate fixed alpha value? xdfanfan General 1 Sun Nov 19, 2017 4:12 pm View latest post
No new posts OpenSceneGraph-3.5.8 dev release tagged robertosfield General 0 Tue Nov 14, 2017 3:59 pm View latest post
No new posts New Defects reported by Coverity Scan... filnet General 0 Tue Oct 31, 2017 5:22 pm View latest post
No new posts OpenSceneGraph static linking for And... tanshihaj Build system [build] 1 Thu Sep 21, 2017 12:56 pm View latest post
No new posts Qt Quick and Android tanshihaj General 7 Tue Sep 19, 2017 2:28 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP