Android NDK错误使用未声明的标识符Opengl-ES

问题描述

我正在尝试使用Cmake和NDK从Android Studio上的C ++源文件构建一个共享库。我经历了很多错误和很多困难。当我尝试构建项目时,我遇到的最新错误是:

Execution failed for task ':mobile:generateJsonModelDebug'.
exception while building Json $C:\Users\User\Documents\B3d\mobile\.cxx\cmake\debug\armeabi-v7a\compile_commands.json (The system cannot find the file specified)

Android Studio,Gradle插件和cmake都是最新的。有什么问题吗?

我尝试使用cmd而不是Android Studio进行编译,但出现此错误:

jni/texture.h:15:10: fatal error: 'list' file not found

在texture.h文件中,有#include <list>

所以我将Application.mk文件添加到包含以下内容的源文件文件夹中

APP_ABI := armeabi-v7a
APP_CPPFLAGS += -std=c++11
APP_STL := c++_shared
APP_CPPFLAGS += -frtti

错误消失了,并显示了一组新的错误:

jni/project.h:50:1: error: unknown type name 'GLint'
error: unknown type name 'GLfloat'; did you mean 'float'?

我认为这与OpenGL有关,因此我在该文件中包含#include 而下一组错误是:

error: use of undeclared identifier 'glFrustum'
error: use of undeclared identifier 'glOrtho'
error: use of undeclared identifier 'GL_FOG'

还有其他一些;可能有什么问题,我使用了#include <GLES2/gl2.h>

好的,我已经看到了问题。这些标识符在OpenGL-ES中不可用。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...