You can install tgui by adding the PPA to your system and install the “libtgui-0.10-dev” package:
sudo add-apt-repository ppa:texus/tgui sudo apt-get update sudo apt-get install libtgui-0.10-dev
You can download, build and install the latest tgui version with the “tgui-git” package from the AUR. There are multiple ways to do this, here is one:
yay -S tgui-git
You can download the source code from the download page and follow the ‘building with CMake’ tutorial for a guide on how to build TGUI.
After you ran
make like explained in the tutorial, you should call
sudo make install to install the libraries which you just built.
To link to the TGUI libraries you only need to add
-ltgui to your compiler command.
g++ main.cpp -ltgui -lsfml-graphics -lsfml-window -lsfml-system -o program
Open the “Project build options” and choose whether you want to change Debug or Release target settings. You can click on the name of your project (here TGUI-Test) and set settings that apply to both Debug and Release.
If you get the following error when running your program then you did install TGUI correctly, but it is not in the shared library cache.
/pathname/of/program: error while loading shared libraries: libtgui.so: cannot open shared object file: no such file or directory
Try to open the terminal and execute
If that doesn’t solve it then make sure the library was installed to a place where your linux distro searches for it.
The easiest workaround is probably to add a new line containing
/usr/local/lib/ (and nothing more) at the end of /etc/ld.so.conf and then run
sudo ldconfig again.