下载源码:[https://github.com/glfw/glfw/releases](https://github.com/glfw/glfw/releases) # 编译 ```bash [yz@test ~]$ unzip glfw-3.3.3.zip [yz@test ~]$ cd glfw-3.3.3 [yz@test ~]$ cmake -DBUILD_SHARED_LIBS=ON . [yz@test ~]$ make [yz@test ~]$ sudo make install ``` -DBUILD_SHARED_LIBS=ON:表示需要编译动态库。 cmake阶段如果缺少库,请自行安装,例如,以下报错: ```bash CMake Error at CMakeLists.txt:233 (message): XInput headers not found; install libxi development package -- Configuring incomplete, errors occurred! ``` 安装 libXi-devel: ```bash [yz@test glfw-3.3.3]$ sudo yum install libXi-devel ``` # 参考 - [How to build & install GLFW 3 and use it in a Linux project](https://stackoverflow.com/questions/17768008/how-to-build-install-glfw-3-and-use-it-in-a-linux-project) - [linux安装glfw3](https://my.oschina.net/geange/blog/1535894)