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 

Building the android examples with Eclipse on mac


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


Joined: 01 Jun 2015
Posts: 1

PostPosted: Mon Jun 01, 2015 4:37 pm    Post subject:
Building the android examples with Eclipse on mac
Reply with quote

Hi,

I'm completely new to openSceneGraph. I have it running more or less on my mac (I still encounter some weird segmentation fault on a code that works perfectly for a friend of mine on Linux) but appart from that I guess I'm fine with it.

However I would like to work on android. I do know how to use the native development on android and I have tried to build one of the exemples: the one for openGLES1. My problem is that I cannot use ndk-build without getting over and over the same mistake:


Code:
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   
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   
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
In file included from jni/OsgMainApp.hpp:21:0,
                 from jni/osgNativeLib.cpp:7:
/Users/lonnibesancon/Desktop/OpenSceneGraph-3.2.2-rc2/buildandroid/include/osg/GL:124:35: fatal error: GL/gl.h: No such file or directory
#include <GL/gl.h>
compilation terminated.
make: *** [obj/local/armeabi/objs/osgNativeLib/osgNativeLib.o] Error 1


For some reasons, the include is not complete on the piece of code above, the include that doesn't work is GL/gl.h.

Now I have MAC OS Yosemite, the ndk 10 and I have modified the Android.mk to have
Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := osgNativeLib
### Main Install dir
OSG_ANDROID_DIR   := /Users/lonnibesancon/Desktop/OpenSceneGraph-3.2.2-rc2/examples/osgAndroidExampleGLES1
LIBDIR          := $(OSG_ANDROID_DIR)/obj/local/armeabi

FRAMEWORK = -framework GLUT
FRAMEWORK += -framework OpenGL

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
   LOCAL_ARM_NEON    := true
   LIBDIR          := $(OSG_ANDROID_DIR)/obj/local/armeabi-v7a
endif

### Add all source file names to be included in lib separated by a whitespace

LOCAL_C_INCLUDES:= /Users/lonnibesancon/Desktop/OpenSceneGraph-3.2.2-rc2/buildandroid/include
LOCAL_CFLAGS    := -Werror -fno-short-enums
LOCAL_CPPFLAGS  := -DOSG_LIBRARY_STATIC

LOCAL_LDLIBS    := -llog -lGLESv1_CM -ldl -lz -lgnustl_static
LOCAL_SRC_FILES := osgNativeLib.cpp OsgMainApp.cpp OsgAndroidNotifyHandler.cpp
LOCAL_LDFLAGS   := -L $(LIBDIR) \
-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

include $(BUILD_SHARED_LIBRARY)
.

Finally, this is the command I'm using:

Quote:
~/Desktop/OpenSceneGraph-3.2.2-rc2/examples/osgAndroidExampleGLES1$ ../../../../android-ndk-r10e/ndk-build


Hope my questions is not dumb and you can help me out.

Thanks in advance anyway;

Cheers,
Lonni
Back to top
View user's profile Send private message Send e-mail
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 Building OSG for Android -- Windowing... bwhaines Build system [build] 0 Sun Apr 23, 2017 2:01 am View latest post
No new posts OSG + Qt on Android Treazy General [3rdparty] 2 Fri Mar 31, 2017 10:44 pm View latest post
No new posts Examples Not Responding; Windows 10 x64 S Senften General 0 Tue Feb 07, 2017 8:37 pm View latest post
No new posts Error building terrain with shapefile... robertosfield VirtualPlanetBuilder [vpb] 0 Mon Feb 06, 2017 9:11 am View latest post
No new posts Error building terrain with shapefile... vinothrajendran4 VirtualPlanetBuilder [vpb] 0 Mon Feb 06, 2017 6:24 am 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