Error building Android version

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
bmiller
Posts: 4
Joined: Fri Jul 01, 2016 6:50 pm

Error building Android version

Post by bmiller »

Hello:

I am trying to build the Android version (ogl-es branch) of Irrlicht on an Ubuntu 14.04 Linux machine with latest updates and a recent version of Android SDK and NDK.

I have done the following so far:

$ svn checkout svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es irrlicht-ogl-es
$ cd irrlicht-ogl-es/source/Irrlicht/Android
$ export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/ndk-bundle:$PATH
$ ndk-build

The NDK build output ends with the following error message:

[arm64-v8a] Compile++ : Irrlicht <= CEGLManager.cpp
jni/../../CEGLManager.cpp: In member function 'virtual bool irr::video::CEGLManager::generateSurface()':
jni/../../CEGLManager.cpp:245:61: error: 'ANativeWindow_setBuffersGeometry' was not declared in this scope
ANativeWindow_setBuffersGeometry(EglWindow, 0, 0, Format);
^
make: *** [obj/local/arm64-v8a/objs/Irrlicht/CEGLManager.o] Error 1

and it does not generate the expected output file in lib/Android

Any ideas ?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error building Android version

Post by CuteAlien »

Hi,

not sure if it helps, but my .bashrc kinda looks like this:

export ANDROID_HOME=/home/micha/android/adt-bundle-linux-x86_64-20131030/sdk
export ANDROID_NDK=/home/micha/android/android-ndk-r10e
export ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/22.0.1
export PATH=.:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_BUILD_TOOLS:$ANDROID_NDK

Did you set ANDROID_HOME before using it?

Which versions for ndk and sdk do you have installed?

ANativeWindow_setBuffersGeometry is part of the android NDK, so I assume for some reason it doesn't use that header in your case, but not sure why (should give a warning that it doesn't find header then I think...).

Note that I removed your other post. Reason we don't want cross-posting in several threads is that it always turns out to be confusing when the discussion get's split (some people answering here, others there). Also chances of finding help don't really increase by cross-posting - our forum is not that big so I read all new posts anyway and I think so do a few others ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error building Android version

Post by CuteAlien »

Maybe try the following:
In CEGLManager.cpp add the following after the other includes:

Code: Select all

 
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#include <android/native_activity.h>
#endif
 
or maybe native_window.h would already be sufficient.

Please tell me if that makes a difference. The reason is that I don't really see right now how CEGLManager.cpp includes that file. Thought it works here, so I have to be missing something...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
bmiller
Posts: 4
Joined: Fri Jul 01, 2016 6:50 pm

Re: Error building Android version

Post by bmiller »

CuteAlien wrote:Maybe try the following:
In CEGLManager.cpp add the following after the other includes:

Code: Select all

 
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#include <android/native_activity.h>
#endif
 
Thanks! With that change I was able to build the binaries including

irrlicht-ogl-es/source/Irrlicht/Android/obj/local/arm64-v8a/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/armeabi/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/armeabi-v7a/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/mips64/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/mips/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/x86_64/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/x86/libIrrlicht.a
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error building Android version

Post by CuteAlien »

Ok, thanks for feedback. I've just added those line to svn now.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply