How to install GLFW library on Visual Studio C++ 2015

When you work as an engineer, it always comes the time when you need to perform some signal processing and visualize your data on a 3D, in real-time. This happened to me once I started playing with IMU (Inertial Measurement Unit): I acquired acceleration and gyroscope data from the sensor, and used my PC to compute the Tait-Bryan angles. However, I wanted somehow to show the 3D orientation, in real time, using some tool. There is a nice programming language called Processing, which allows to do that, but it does not have all the "power" of C++.

Therefore, after searching a bit on Google, I found a nice library called GLFW, which uses OpenGL and, most important, is free. However, using it on Visual Studio C++ 2015 is not straight-forward, so I decided to prepare a simple guide, in PDF (GLFW_install_guide) which explains how to configure Visual Studio (less than 5 minutes required) in order to be ready to work for your project.

I will summarize here below the main steps. First, create a new project "Win32 Console Application".

Select "Empty project".

Right click on project name and Properties, and modify include and library directories.

Add Additional Dependencies on Linker -> Input.

Build the project and run it. Don't forget to include "GLFW/glfw3.h".

In case you want to test if everything works fine on your PC, all you have to do is to, at first, install Visual Studio C++ on your PC, then download the GLFW libraries and extract them in your C:\ folder. The source code of the program shown above is available here: Fuelino_IMU_3D_20170215m. Just build it and run. It will load the sensors raw data inside "input.log", calculate Tait-Bryan angles (yaw, pitch, roll) and show them in real-time on the 3D window.

Author: Davide Cavaliere

I am an Italian Electrical Engineer graduated at Politecnico di Milano. My interests are motorcycles and cars, electronics, programming, Internet of Things, and Japanese culture.

Leave a Reply

Your email address will not be published. Required fields are marked *