下载源码:https://github.com/glfw/glfw/releases
[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
-DBUILDSHAREDLIBS=ON:表示需要编译动态库。
cmake阶段如果缺少库,请自行安装,例如,以下报错:
CMake Error at CMakeLists.txt:233 (message): XInput headers not found; install libxi development package -- Configuring incomplete, errors occurred!
安装 libXi-devel:
[yz@test glfw-3.3.3]$ sudo yum install libXi-devel