- OpenGL Data Visualization Cookbook
- Raymond C. H. Lo William C. Y. Lo
- 304字
- 2021-07-16 20:42:33
Installing the GLFW library in Windows
There are two ways to install the GLFW library in Windows, both of which will be discussed in this section. The first approach involves compiling the GLFW source code directly with CMake for full control. However, to simplify the process, we suggest that you download the precompiled binary distribution.
Getting ready
We assume that you have successfully installed both Visual Studio 2013 and CMake, as described in the earlier section. For completeness, we will demonstrate how to install GLFW using CMake.
How to do it...
To use the precompiled binary package for GLFW, follow these steps:
- Create the
C:/Program Files (x86)/glfw-3.0.4
directory. Grant the necessary permissions when prompted. - Download the
glfw-3.0.4.bin.WIN32.zip
package from http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.bin.WIN32.zip and unzip the package. - Copy all the extracted content inside the
glfw-3.0.4.bin.WIN32
folder (for example, includelib-msvc2012
) into theC:/Program Files (x86)/glfw-3.0.4
directory. Grant permissions when prompted. - Rename the
lib-msvc2012
folder tolib
inside theC:/Program Files (x86)/glfw-3.0.4
directory. Grant permissions when prompted.
Alternatively, to compile the source files directly, follow these procedures:
- Download the source package from http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.zip and unzip the package on the desktop. Create a new folder called
build
inside the extractedglfw-3.0.4
folder to store the binaries.and opencmake-gui
. - Select
glfw-3.0.4
(from the desktop) as the source directory andglfw-3.0.4/build
as the build directory. The screenshot is shown as follows: - Click on Generate and select Visual Studio 12 2013 in the prompt.
- Click on Generate again.
- Open the
build
directory and double-click on GLFW.sln to open Visual Studio. - In Visual Studio, click Build Solution (press F7).
- Copy build/src/Debug/glfw3.lib to C:/Program Files (x86)/glfw-3.0.4/lib.
- Copy the
include
directory (insideglfw-3.0.4/include
) to C:/Program Files (x86)/glfw-3.0.4/.
After this step, we should have the include
(glfw3.h
) and library
(glfw3.lib
) files inside the C:/Program Files (x86)/glfw-3.0.4
directory, as shown in the setup procedure using precompiled binaries.
- Software Defined Networking with OpenFlow
- Visual Basic程序設計實驗指導(第4版)
- JS全書:JavaScript Web前端開發指南
- 從學徒到高手:汽車電路識圖、故障檢測與維修技能全圖解
- Java Web程序設計任務教程
- Linux:Embedded Development
- 焊接機器人系統操作、編程與維護
- Kotlin開發教程(全2冊)
- Django 3.0入門與實踐
- Couchbase Essentials
- Azure Serverless Computing Cookbook
- 硬件產品設計與開發:從原型到交付
- CodeIgniter Web Application Blueprints
- Practical Predictive Analytics
- DevOps 精要:業務視角