Mac 搭建GLFW

2018-10-16  本文已影响248人  嘉言火

# Mac搭建GLFW踩坑(10.14):

## 正常流程:

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

glfw 3.2.1

glee 2.1.0

## macOS High Sierra error:

### 错误日志:

ERROR: Setting <GLFWContentView: 0x1006c6430> as the first responder for window <GLFWWindow: 0x10052f1c0>, 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

上一篇下一篇

猜你喜欢

热点阅读