CodeBlocks (precompiled library)

Open the “Project build options”.

CodeBlocks Opening Project Build Options

On the left side you can choose whether you want to change debug or release target settings. Or you can just click on the name of your project (here TGUI-Test) to set them for both. TGUI requires C++11, so check the “-std=c++11” option.

CodeBlocks Compiler Flags

In the “Search directories” of the “Compiler” add the path to the include directory.

CodeBlocks Compiler Search Directories

In the “Search directories” of the “Linker” add the path to the lib directory.

CodeBlocks Linker Search Directories

In “Linker settings” under “Other linker options” add ‘-ltgui’ in the ‘Release’ settings and/or add ‘-ltgui-d’ in the ‘Debug’ settings. When linking statically, you have to use ‘-ltgui-s’ and ‘-ltgui-s-d’ instead of course. Also note that the order has to be correct: first tgui, then the libraries from sfml.

CodeBlocks Linker Search Directories

When using shared libraries, don't forget to copy tgui.dll to your project’s folder.