Albino Rodrigues wrote:
Hi,
I am currently in the process of doing a test port of an OSG application we
have here to Odroid - ODROID_WEBSITE. It is basically an entertainment device
built on top of Android 2.1.
While going through the Android toolchain documentation for the latest NDK
(rev3) I noticed two critical points.
No standard C++ library support:
--------------------------------
The Android 1.5 system does not use any C++ standard library, and does
not provide one to applicative native code. Instead, a very limited set
of headers are provided (see docs/STABLE-APIS.TXT) which correspond to
the C++ support code used to build the Android platform.
It is possible to hack existing C++ STL implementations to work on top
of this, but this is not supported yet. We recommend trying with uSTL
and STLport at this point if you really need this.
No support for C++ exceptions and RTTI:
---------------------------------------
The Android 1.5 system image lacks several features necessary to reliably
implement C++ exceptions and RTTI. C++ code that depends on these features
will simply not link or run appropriately on Android 1.5
I'm curious if anyone has worked with Android's NDK and OSG and has a work
around or other ideas.
I found WEBSITE_WITH_PATCH which adds exceptions, STL and RTTI but reading
through the android google groups people are having issues with it.
Is this the modified NDK you mean:
http://www.crystax.net/android/ndk-r3.php
It includes a full STL implementation.
I tried adding STLport to the release NDK, but it was problematic at
best. A much easier solution was to use this modified NDK.
I also was able to set up a CMake toolchain for OSG that looked like it
was on the way to working. I hit a brick wall when I got to osgGA.
(This is a third critical point that you didn't mention :-) ) At some
point, you need to define your Activity in Java and make the calls from
there to the native code. You also need to somehow create a
GLSurfaceView (usually done in a second Java class). I didn't have time
to explore these issues yet.
The iPhone gets this stuff for free because OSG already has the
necessary backend code to create OSX windows and contexts.
I'll attach the CMake toolchain file for the Android NDK in case it's
useful...
--"J"
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm-elf)
set(CMAKE_C_LINK_FLAGS "-nostdlib")
set(CMAKE_CXX_LINK_FLAGS "-nostdlib")
set(CMAKE_CXX_COMPILER
/irl/work/jdaly/android/android-ndk-r3-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc)
set(CMAKE_CXX_COMPILER
/irl/work/jdaly/android/android-ndk-r3-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-c++)
set(CMAKE_ROOT_PATH
/irl/work/jdaly/android/android-ndk-r3-crystax/build/prebuilt/linux
-x86/arm-eabi-4.4.0/bin)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org