Android-NDK构建系统(构建hello-gl2)
我使用 这个包 在我的 Archlinux 上下载并安装了 Android-NDK。
按照 此页面,但如果我尝试对 hello-gl2
执行相同操作,则会出现一些错误;看起来它找不到一些头文件:
$ ../../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
和 GLES2/gl2ext.h
然而存在于 $(NDK)/platforms/android 中-4/arch-arm/usr/include/
,看起来$(NDK)/build/core/setup-toolchain.mk
应该设置这样的包含路径。
有人遇到过同样的问题吗?我怎样才能编译这个示例?
那么,还有其他选项可以轻松构建 Android-NDK 应用程序吗?这个构建系统对我来说似乎相当复杂,我更喜欢使用 cmake 来构建我的应用程序。
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/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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保 APP_ABI 和 APP_PLATFORM 在您的 Application.mk 中定义,并且您的 APP_PLATFORM 应高于 android-5...检查:gl.h & glext.h 未找到
例如,在 Application.mk 中定义:
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:
就我而言,它缺少包含以下内容的文件default.properties:
将此文件放入根项目目录中。这可能有帮助。
In my case it was missing the file default.properties with such content:
Put this file into the root project directory. It may help.
您需要使用更高的SDK。 5 级是构建 OpenGL ES 2 代码的最低级别。
You need to use a higher SDK. Level 5 is the minimum to build OpenGL ES 2 code.