working on lib-android-ogre-3d on github, w/ issue

Problems building or running the engine, queries about how to use features etc.
chbfiv
Gnoblar
Posts: 2
Joined: Sat Nov 05, 2011 10:32 pm

working on lib-android-ogre-3d on github, w/ issue

Post by chbfiv »

I'm creating an open source android build project for ogre. The project references the current 'default' branch and can be found here.
https://github.com/chbfiv/lib-android-ogre-3d

However I'm having an issue with the error below.

/home/chbfiv/dev/ogre//OgreMain/src/OgrePlatformInformation.cpp:44:32: error: sys/sysctl.h: No such file or directory
make: *** [/home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o] Error 1

I'm defining the flag as arg's into the build system, however it seems that it's not working because the path to that error is still being compiled.
LOCAL_CFLAGS += -D__ANDROID__
LOCAL_CPPFLAGS += -D__ANDROID__

looking below you can see the compare w/ OGRE_PLATFORM_ANDROID, which is defined by __ANDROID__

1] *********************** OgreMain/src/OgrePlatformInformation.cpp lines 34-49 ********************************
...
#if OGRE_COMPILER == OGRE_COMPILER_MSVC
#include <excpt.h> // For SEH values
#if _MSC_VER >= 1400
#include <intrin.h>
#endif
#elif OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_PLATFORM != OGRE_PLATFORM_NACL
#include <signal.h>
#include <setjmp.h>

#if OGRE_CPU == OGRE_CPU_ARM && OGRE_PLATFORM != OGRE_PLATFORM_ANDROID
#include <sys/sysctl.h>
#if _MACH_
#include <mach/machine.h>
#endif
#endif
#endif
...
**************************************************************************************
:?:
Also, thanks to http://www.ogre3d.org/tikiwiki/Ogre+And ... evelopment for the general direction. I think I'm close to having it building. next would be getting a demo working.
chbfiv
Gnoblar
Posts: 2
Joined: Sat Nov 05, 2011 10:32 pm

Re: working on lib-android-ogre-3d on github, w/ issue

Post by chbfiv »

Here is the full command w/ error

arm-linux-androideabi-g++ -MMD -MP -MF /home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-exceptions -fno-rtti -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/home/chbfiv/dev/ogre/include -I/home/chbfiv/dev/ogre/OgreMain/include -I/home/chbfiv/dev/ogre/OgreMain/include/Android -I/home/chbfiv/dev/ogre/OgreMain/include/Threading -I/home/chbfiv/dev/ogre/OgreMain/src/nedmalloc -I/home/chbfiv/dev/ogre/Components/RTShaderSystem/include -I/home/chbfiv/dev/ogre/RenderSystems/GLES2/include -I/home/chbfiv/dev/ogre/RenderSystems/GLES2/src/GLSLES/include -I/home/chbfiv/dev/ogre/RenderSystems/GLES2/include/Android -I/home/chbfiv/dev/ogre/Plugins/ParticleFX/include -I/home/chbfiv/dev/freetype-2.1.10/include -I/home/chbfiv/dev/boost_1_47_0 -I/home/chbfiv/dev/FreeImage-3.15.1/Source -I/home/chbfiv/dev/zziplib-0.13.60 -I/home/chbfiv/dev/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include -I/home/chbfiv/dev/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -I/home/chbfiv/dev/ogre -DANDROID -DFREEIMAGE_LIB=1 -DOGRE_NONCLIENT_BUILD=1 -DANDROID_NDK -Werror -D__ANDROID__ -Wa,--noexecstack -fexceptions -frtti -D__ANDROID__ -O0 -g -DDEBUG -frtti -fexceptions -I/home/chbfiv/dev/android-ndk-r6b/platforms/android-9/arch-arm/usr/include -c /home/chbfiv/dev/ogre//OgreMain/src/OgrePlatformInformation.cpp -o /home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o && ( if [ -f "/home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o.d.org" ]; then rm -f /home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o.d && mv /home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o.d.org /home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o.d; fi )
/home/chbfiv/dev/ogre//OgreMain/src/OgrePlatformInformation.cpp:44:32: error: sys/sysctl.h: No such file or directory
make: *** [/home/chbfiv/workspace/marble-madness/lib-android-ogre-3d/obj/local/armeabi-v7a/objs-debug/ogre-3d//OgreMain/src/OgrePlatformInformation.o] Error 1
nanarth
Gnoblar
Posts: 6
Joined: Wed Feb 27, 2008 2:26 pm
Location: Grenoble, France
x 2

Re: working on lib-android-ogre-3d on github, w/ issue

Post by nanarth »

Hi chbfiv !!

I tried to compile your project and find out that it seems the TEGRA2 platform detection conficts with android in OgrePlatform.h. For me both linux and __arm__ was detected so it was compiled using OGRE_PLATFORM_TEGRA2 instead of OGRE_PLATFORM_ANDROID. See the code from OgrePlatform.h below

Code: Select all

#elif defined(linux) && defined(__arm__)
// TODO: This is NOT the correct way to detect the Tegra 2 platform but it works for now.
// It doesn't appear that GCC defines any platform specific macros.
#       define OGRE_PLATFORM OGRE_PLATFORM_TEGRA2
#elif defined(__ANDROID__)
#       define OGRE_PLATFORM OGRE_PLATFORM_ANDROID
#elif defined( __native_client__ ) 
Anyway, thank you for your project, i'm also trying to compile Ogre with ndk in a clean way and do not succeed. Your work is good and clean :D, thank you for that but there is still issues on wstring and other stuff. Does anyone has a pointer to a thread that explains properly how to build Ogre on android ? Especialy i would like to know what kind of OgreBuildSettings.h I should use for the compilation?

What is the right way to generate the OgreBuildSettings.h for ANDROID ?

Thank you all