Android-NDK build system (hello-gl2 creation)

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

Failed to create (and run) the sample hello-jniaccording to the manual on this page , but if I try to do the same with hello-gl2I get some errors; It looks like it cannot find the 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/jni/gl_code.cpp:23:26: error: GLES2/gl2ext.h: No such file or directory
--- SNIP ---

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

Has anyone encountered the same problem? How can I compile this sample?
And then are there any other features that make it easy to create Android-NDK applications? This build system seems pretty complicated to me, and I'd rather use cmake to build my applications.

+3
source share
3 answers

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

for example, in Application.mk define:

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

In my case, the default.properties file with the following content was missing :

target=android-5

Put this file in the root directory of the project. This can help.

+2

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

0
source

Source: https://habr.com/ru/post/1786137/


All Articles