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


 
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: Thu Sep 21, 2017 12:56 pm    Post subject:
OpenSceneGraph static linking for Android
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

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







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
kornerr
Appreciator


Joined: 01 Oct 2013
Posts: 233

PostPosted: Sat Sep 23, 2017 8:52 am    Post subject:
OpenSceneGraph static linking for Android
Reply with quote

Care to explain the problem you fixed?

On 21 September 2017 at 19:58, Kamil Zaripov <> wrote:
Quote:
Nevermind, I've already fix this problem.

Cheers,
Kamil

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








------------------
Post generated by Mail2Forum
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 Qt Quick and Android tanshihaj General 7 Tue Sep 19, 2017 2:28 pm View latest post
No new posts OpenSceneGraph-3.4.1 released! robertosfield General 3 Mon Aug 28, 2017 5:39 pm View latest post
No new posts OpenSceneGraph-3.4.1-rc3 tagged robertosfield General 2 Fri Aug 25, 2017 3:27 pm View latest post
No new posts OpenSceneGraph-3.4.1-rc2 tagged robertosfield General 3 Tue Aug 22, 2017 11:25 am View latest post
No new posts OpenSceneGraph static linking for And... tanshihaj Build system [build] 1 Sun Aug 13, 2017 10:09 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