在Mac OS上编译Box2D时出错:找不到EGL标识符

Error compiling Box2D on Mac OS : EGL identifiers not found

本文关键字:出错 找不到 EGL 标识符 Box2D Mac OS 编译      更新时间:2023-10-16

试图为我正在进行的c++SFML项目创建/链接Box2D库。

以下是我所做的:从github下载新的Box2D源代码(https://github.com/erincatto/Box2D)

cd Box2D-master/Box2D/Build

cmake ..

make

它通过了一半,然后当它到达时

[ 68%] Building C object glfw/CMakeFiles/glfw.dir/egl_context.c.o

它会抛出一堆错误,比如

/Users/wstone/Documents/Box2D-master/Box2D/glfw/egl_context.c:53:35: error: unknown type name 'EGLint'; did you mean 'GLint'? static const char* getErrorString(EGLint error) ^~~~~~ GLint /System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:15:18: note: 'GLint' declared here typedef int32_t GLint; ^ /Users/wstone/Documents/Box2D-master/Box2D/glfw/egl_context.c:57:14: error: use of undeclared identifier 'EGL_SUCCESS' case EGL_SUCCESS: ^ /Users/wstone/Documents/Box2D-master/Box2D/glfw/egl_context.c:59:14: error: use of undeclared identifier 'EGL_NOT_INITIALIZED'

有人有什么见解吗?我用brew install cmake安装了cmake,如果这很重要的话,

我也遇到了同样的问题,Box2d Master没有稳定的版本,请尝试使用下面链接的发布版本

https://github.com/erincatto/Box2D/releases