You can build your program with 2 settings: Debug or Release. In the screenshot (
https://tgui.eu/resources/CodeBlocks-0.7/LinkerOptions.jpg) you will see those on the left side. If you click on the project name then it shows settings that are shared between the options, if you click on Release or Debug then the rest of the window you show settings specific to either Release or Debug. Usually you will always want to use Debug while developing and only build a Release version when you want to run the program on someone elses computer.
In CMake you set an option CMAKE_BUILD_TYPE. Was it set to Debug or Release? When your project is in Release mode (which you can change somewhere in a combo box at the top of codeblocks) then you must use libraries with Release as build type. Similarly in a project that uses Debug, you must use Debug libraries.
The tgui library that you build has a different name depending on what CMAKE_BUILD_TYPE and TGUI_SHARED_LIBS were set to in CMake.
- libtgui.a if CMAKE_BUILD_TYPE=Release and TGUI_SHARED_LIBS=TRUE
- libtgui-d.a if CMAKE_BUILD_TYPE=Debug and TGUI_SHARED_LIBS=TRUE
- libtgui-s.a if CMAKE_BUILD_TYPE=Release and TGUI_SHARED_LIBS=FALSE
- libtgui-s-d.a if CMAKE_BUILD_TYPE=Debug and TGUI_SHARED_LIBS=FALSE
The linker settings from the screenshot should already contain sfml-system, sfml-window and sfml-graphics. Adding TGUI is identical to what you should already have there. You just have to add tgui on top of that list (not at the bottom).
- If you build dynamic TGUI libraries (TGUI_SHARED_LIBS was set to TRUE in cmake) and will include tgui.dll next to your exe:
On the left side of the window, if Release is selected, under "Other linker options" you need to add "-ltgui" (without the quotes).
If Debug is selected, you need to add "-ltgui-d".
- If you build static TGUI libraries (TGUI_SHARED_LIBS was set to FALSE in cmake) and have SFML_STATIC defined in your project:
If Release is selected, you need to add "-ltgui-s".
If Debug is selected, you need to add "-ltgui-s-d".
If you followed the tuturial step by step then you will have only build one TGUI library (either Debug or Release), so only one configuration will work in CodeBlocks. If you want to be able to build both Debug and Release versions of your program then you just need to follow the "CMake" and "Building the library" steps from the tutorial a second time, but this time with CMAKE_BUILD_TYPE changed to the other option.