Android-NDK build system (building hello-gl2)
Solution 1
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
Solution 2
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.
Comments
-
peoro almost 2 years
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 withhello-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/jni/gl_code.cpp:23:26: error: GLES2/gl2ext.h: No such file or directory --- SNIP ---
GLES2/gl2.h
andGLES2/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. -
peoro over 13 yearsI've got installed android-sdk r08-2 and android-ndk r5-1. Do I need to specify which version to use to
ndk-buidl
? -
Brandon over 13 yearsYour installs are fine. Adjust the hello-jni project from inside eclipse.
-
peoro over 13 years
hello-jni
compiles and runs fine. Problem is withhello-gl2
, which doesn't compile when I runndk-build
... -
Brandon over 13 yearsI understand that. When I had the same problem, all I needed to do was adjust the API level of my project.
-
david.schreiber almost 9 yearsEclipse -> Android Studio migration was missing this. Now NDK builds work! Thanks!