There are currently no precompiled libraries for MinGW yet.
Download the source code from the download page and follow the ‘building with CMake’ tutorial for a guide on how to compile TGUI yourself.
To add TGUI to your CodeBlocks project, start by opening the project build options.
In both debug and release mode (at the same time by clicking on the project name at the top left), add the compiler and linker search directories. The compiler directory is the “include” folder from TGUI while the linker directory is the one that contains the .a file (will be the “lib” folder if you downloaded precompiled libraries, or a lib subfolder in the build directory if you build TGUI yourself with CMake and didn’t copy the files to somewhere else). The “C:\TGUI_Path" is to be replaced with the location of the TGUI folder on your computer, you can place the folder anywhere you want.
GCC 6 and newer will automatically use c++14, but if you have an older MinGW version then you will also need to add the “-std=c++14” compiler flag.
If you want to use TGUI with a .dll file then follow the instruction in the “Dynamic linking” section below. If you want the TGUI library to be linked into your executable (so that you don’t need to include a .dll with your exe) then follow the “Static linking” section.
In the “Release” configuration, add “tgui” to the link libraries.
In the “Debug” configuration, add “tgui-d” to the link libraries.
Note that the order in which you list the libraries is important. You must list TGUI above the the libraries on which it depends (SFML in the above screenshots).
Don’t forget to copy tgui.dll or tgui-d.dll (depending on whether the executable is build in Debug or Release mode) next to your executable.
When linking statically, you have to add “TGUI_STATIC” to the compiler defines.
In the “Release” configuration, add “tgui-s” to the link libraries.
In the “Debug” configuration, add “tgui-s-d” to the link libraries.
Note that the order in which you list the libraries is important. You must list TGUI above the the libraries on which it depends (SFML in the above screenshots).