开发者

Android-NDK build system (building hello-gl2)

I downloaded and installed Android-NDK on my Archlinux, using this package.

Got no issues building (and running) the sample hello-jni following the guide on this page, but if I try to do the same with hello-gl2 I get some errors; it looks like it cannot find some header files:

$ ../../ndk-build 
/usr/bin/make -f /opt/android-ndk/build/core/build-local.mk
Compile++ thumb  : gl2jni <= gl_code.cpp
/opt/android-ndk/samples/hello-gl2/jni/gl_code.cpp:22:23: error: GLES2/gl2.h: No such file or directory
/opt/android-ndk/samples/hello-gl2/开发者_JAVA技巧jni/gl_code.cpp:23:26: error: GLES2/gl2ext.h: No such file or directory
--- SNIP ---

GLES2/gl2.h and GLES2/gl2ext.h are however present in $(NDK)/platforms/android-4/arch-arm/usr/include/, and it looks like$(NDK)/build/core/setup-toolchain.mk should set such include path.

Has anybody encountered the same issue? How can I compile this sample?

And then, are there other options to easily build Android-NDK applications? This build system seems quite complicated to me, and I'd prefer using cmake to build my applications.


make sure that APP_ABI and APP_PLATFORM is defined in your Application.mk and your APP_PLATFORM should be higher than android-5... check: gl.h & glext.h not found

for example, in Application.mk define:

APP_ABI := armeabi #armeabi-v7a
APP_STL := stlport_static
APP_PLATFORM := android-8


In my case it was missing the file default.properties with such content:

target=android-5

Put this file into the root project directory. It may help.


You need to use a higher SDK. Level 5 is the minimum to build OpenGL ES 2 code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜