Mac 搭建GLFW

# Mac搭建GLFW踩坑(10.14):

## 正常流程:

https://www.jianshu.com/p/25d5fbf792a2

glfw 3.2.1

glee 2.1.0

## macOS High Sierra error:

### 错误日志:

ERROR: Setting as the first responder for window , but it is in a different window ((null))! This would eventually crash when the view is freed. The first responder will be set to nil.

### 原因:

glfw3.2.1不支持macOS High Sierra

而且brew最新版为3.2.1,所以需要手动编译glfw3.3 来解决

## 编译glfw3.3

### 编译脚本

git clone https://github.com/glfw/glfw.git

cd glfw

mkdir build

cd build

export MACOSX_DEPLOYMENT_TARGET=10.14

cmake -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../

make

make install

安装完成后动态库路径

/usr/local/include

/usr/local/lib

你可能感兴趣的:(Mac 搭建GLFW)