C++ - CMake - Setup with Cygwin

There are many ways to create a Makefile. In this tutorial we are going to see how to generate a Makefile with CMake on Windows. Indeed, CMake is a complex but interesting tool that can generate native Makefiles for the compiler of your choice. But it’s not all, CMake can also create some useful project files, for a lot of IDE (such as Visual Studio or Eclipse for example) and almost every OS (like GNU/Linux, Windows, Mac, etc.). ...

August 18, 2017

C++ - Google Test - Set up projects to use the gtest library

Creating a library for your Google Test framework is a good practise. It separates your main project, your library and your tests code. A great way to deal with your dev team and your test team. Visual Studio will be our IDE for this tutorial. So let’s get started. First of all For this tutorial we need: Visual Studio 2017 Community: https://www.visualstudio.com/downloads/ Google Test 1.8.0: https://github.com/google/googletest/releases Google Test will be installed in this directory: ...

August 10, 2017

C++ - Google Test - Generating the gtest.lib from gtest.sln with Visual Studio

Google Test framework is provided with a solution already generated that we can use with Visual Studio. It’s the gtest.sln file. But to use it we have to accomplish some steps in order to having it working properly. This is what we will see in this Google Test tutorial. Let’s get started. First of all For this tutorial we need: Visual Studio 2017 Community: https://www.visualstudio.com/downloads/ Google Test 1.8.0: https://github.com/google/googletest/releases Google Test will be installed in this directory: ...

August 7, 2017

C++ - Google Test - Using a Makefile to generate tests

After succeeded in accomplishing the Google Test setup by hand we are going to see how to use a Makefile to create our running tests. Of course, this time, we will use the Cygwin CLI in order to create our tests example. So don’t wait anymore, let’s get started. First of all For this Google Test tutorial, we need some useful tools to create an example: Google Test Cygwin Google Test Of course, we need the Google Test framework. ...

August 6, 2017

C++ - Google Test - Setup Visual Studio by hand

Before playing with the Google Test library, it’s necessary to install it. This is what this tutorial is made of, a bunch of elements in order to set up it. In our example, we are going to use Visual Studio 2017, so on Windows, without any Command-Line Interface (CLI) nor the RUN_ALL_TESTS() macro. First of all Two tools are necessary to realise this Google Test tutorial: Visual Studio Google Test Visual Studio We admit you have already downloaded Visual Studio 2017, but if not you can always do it. ...

August 3, 2017

C++ - Qt Framework - Using Jenkins to generate an .EXE file

In this tutorial we are going to see how to download a project directly on GitHub, generate makefiles of this project, compile it and copy several dynamic-link libraries from a directory to another one. And all that automatically! Let’s see this in this Jenkins setup for Qt on Windows with MinGW. First of all We’ll use one of my project that I already put on GitHub in order to use it as an example: ...

July 10, 2017

C++ - Qt Framework - Moving a shape with arrow keys

Playing with the keyboard is an interesting way of learning the Qt framework. In this tutorial we are going see, indeed, how to use the arrow keys in order to move a shape. This shape is a circle, with only few properties to handle with. Let’s get started. First of all In this Qt example we are going to use an interface to specify that our shape is movable. We’ll also define a constructor for this shape in order to set their useful properties. ...

June 14, 2017

C++ - OpenGL - Using the OR and LEFT SHIFT operators to retrieve the display mode with strings

The following tutorial will show you how to exploit data taken from a binary variable. In order to explain it, we are going to use the GLUT OpenGL library. The display mode uses indeed this kind of mechanism with the OR operator, symbolized with the famous pipe: “|”. And we’ll use the LEFT SHIFT operator “«” to check data. Let’s dive into these binary operators. First of all In the GLUT library there are defines in the freeglut_std.h file such as GLUT_RBG, GLUT_INDEX, GLUT_DOUBLE, GLUT_DEPTH, etc. ...

August 30, 2015

C++ - OpenGL - Checking the FreeGLUT, GLEW and OpenGL version

First thing to deal with OpenGL is to know which version you have on your operating system. For this tutorial we will test it on Windows. And because we are testing the OpenGL version, we will also check what is the FreeGLUT and GLEW version. Explanation To create code for OpenGL 3.3, you have to have a graphic card that handles OpenGL 3.3. If you don’t know which version you have, the code below will show you this. ...

August 10, 2015

C++ - OpenGL - Adding an icon to the executable with Visual Studio

To have an executable file that seems professional, it’s necessary to have your own icon when someone launches your program. This tutorial could easily adapted to any application generated from Visual Studio on Windows. This icon is generally the logo of the software, game or application you created. First of all Creating an ICO file The icon for the program must be an ICO format. It means that the extension must be .ico, like for example icon.ico. ...

August 2, 2015