我正在参与 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/