android - OpenGL-ES Android : function pointers esUtil. h

标签 android c opengl-es function-pointers syntax-error

我正在参与 Linux FC16 中的 OpenGL 项目。我们已经做了很多 3D 工作,到目前为止还不错。

本月该公司决定将整个系统移植到 OpenGL-ES。

我已经像往常一样安装了 OpenGL ES:

yum install make gcc mesa-libGLES-devel mesa-libEGL-devel
ref. http://code.google.com/p/opengles-book-samples/wiki/Instructions

在 Eclipse IDE 上还包含 ES:

Project > Properties > C/C++ Build > Settings > GCC C Linker > Libraries > Libraries (-l)+:
EGL
GLES

尝试运行编译器,出现错误:

../src/esUtil.h:84:21: error: expected ‘)’ before ‘*’ token
../src/esUtil.h:85:21: error: expected ‘)’ before ‘*’ token
../src/esUtil.h:86:21: error: expected ‘)’ before ‘*’ token

这将我引向此:

/// Callbacks
void (ESCALLBACK *drawFunc) ( void* );
void (ESCALLBACK *keyFunc) ( void*, unsigned char, int, int );
void (ESCALLBACK *updateFunc) ( void*, float deltaTime );
ref. http://code.google.com/p/angleproject/source/browse/trunk/samples/gles2_book/Common/esUtil.h?r=486

我尝试添加额外的括号,但无论如何它都没有修复它。这简直让我发疯。

任何建议或评论都非常感谢!

最佳答案

在 esUtil.h 的顶部尝试:

#define __cdecl

看看它是否构建。如果确实如此,那么您就会遇到问题,因为 __cdecl 是 gcc 不支持的 Windows 定义。

我认为修复方法是:

#define __cdecl __attribute__((__cdecl__))

PS:Cdecl 是一个 Visual C 扩展,gcc 不支持(我认为)。

关于android - OpenGL-ES Android : function pointers esUtil. h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8490182/

相关文章:

android - Camera2 录像

c - 如何在自己的项目中使用暗网?

c - Linux 上的用户空间串行通信库

java - 安卓OpenGL ES 2.0 : Setting Unique Colors for Objects with same Fragment Shader

android - Firestore : Totally disable cache for read and write

java - 用拇指保存图像并在 imageView android 上显示

android - 由于内存不足,操作系统强制关闭应用程序后的警报管理器状态

c - Windows:从内核终止进程的不同方法

android - VTK 错误在着色器 VAO 和 EGL_BAD_DISPLAY 中设置 'vertexMC'

android - 当在 Java SurfaceView 中创建 NativeWindowType 时,如何从 native 函数创建 EGL 上下文?