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

Error compiling Box2D on Mac OS : EGL identifiers not found

正在尝试为我正在处理的 c++ SFML 项目创建/link Box2D 库。

这是我所做的: 从 github (https://github.com/erincatto/Box2D)

下载新的 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 没有稳定的版本,尝试使用下面的发布版本 link

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