Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm new to irrlicht and I have started with irrlicht android port. I have made the following changes to android.mk file:

LOCAL_CFLAGS := -O3 -DANDROID_NDK -DDISABLE_IMPORTGL -I./../include/ -I./include/ -I/documents/karthik/android/android-ndk-r9/platforms/android-18/arch-arm/usr/include

LOCAL_LDLIBS := -L/documents/karthik/android/android-ndk-r9/platforms/android-14/arch-arm/usr/lib/libGLESv1_CM.so -ldl -llog -L/documents/karthik/android/android-ndk-r9/platforms/android-14/arch-arm/usr/lib/libGLESv1_CM.so

I have tried compiling irrlicht android using ndk-build in terminal.It showed the following errors at first:

In static member function 'static void irr::os::Printer::log(const c8*, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(wchar_t const*, irr::ELOG_LEVEL)':
 error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(const c8*, const c8*, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
In static member function 'static void irr::os::Printer::log(const c8*, const path&, irr::ELOG_LEVEL)':
error: format not a string literal and no format arguments [-Werror=format-security]
make: *** [obj/local/armeabi/objs/irrlicht/os.o] Error 1

and then I googled that and made changes in os.cpp file as follows:

Changed the code,

__android_log_print(ANDROID_LOG_INFO, "log", message);

to

__android_log_print(ANDROID_LOG_INFO, "log","%s", message);

This change solved that issue, and then I got another error:

In file included from jni/importgl.cpp:55:0:
jni/importgl.h:37:22: fatal error: GLES/egl.h: No such file or directory

Again I changed GLES/egl.h to EGL/egl.h and solved that issue, got:

fatal error: irrlicht.h: No such file or directory 

I even solved this , atlast I'm here with this error:

error: 'EglDisplay' was not declared in this scope
error: 'EglSurface' was not declared in this scope
error: 'EglWindow' was not declared in this scope
error: 'EglContext' was not declared in this scope
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Found the solution for the issue, There is no need to edit Android.mk file while compiling irrlichtandroid. In project/default.propeties , I have changed:

target=android-4

to

target=android-18

And when:

In file included from jni/importgl.cpp:55:0:
jni/importgl.h:37:22: fatal error: GLES/egl.h: No such file or directory

this error occurred I did a mistake by changing GLES/egl.h to EGL/egl.h but that is not the solution for the issue. In include/IrrCompileConfig.h I have commented out:

//#define _IRR_COMPILE_WITH_OGLES1_

since I need only OpenGL ES 2. This solved the issue , irrlichtandroid compiled successfully using ndk-build , libirrlicht.so file generated in my project libs directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.