Type the following in the terminal in order to install tgui. Of course you will have to be inside the downloaded tgui directory.
Open the “Project build options” and 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) and set them for both.
Add ‘-ltgui’ to the “Linker settings” under “Other linker options”. The order of linking has to be correct: first tgui, then the libraries from sfml, namely graphics, windows and system. (you might also need to add -lGL to the list)
In the “Search directories” of the “Compiler” add the path to tgui.
You should now be able to use TGUI.
To test if it is working, simply take a working example code from sfml, include “TGUI\TGUI.hpp” and change sf::RenderWindow to tgui::Window.
It is possible to get the following error when linking to TGUI:
“/pathname/of/program: error while loading shared libraries: libtgui.so: cannot open shared object file: no such file or directory”
If you get this then you did install tgui correctly, but it is not in the shared library cache.
All you have to do is open the terminal, type “sudo ldconfig”, hit enter and type your password.
If that doesn’t solve it then make sure the library was installed to a place where your distro searches for it.
One of the things you could do is add “/usr/local/lib/” (without the quotes) to /etc/ld.so.conf and then run “sudo ldconfig” again.