Type the following in the terminal in order to install tgui. Of course you will have to be inside the downloaded tgui directory.
cmake .
sudo make install -j6
The two things to add is linking to tgui and tell the compiler that it uses c++11.
g++ main.cpp -ltgui -lsfml-graphics -lsfml-window -lsfml-system -std=c++11 -o program
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)
You must also enable c++11.
If you have an older compiler version and don’t have the “-std=c++11″ option, then use “-std=c++0x” instead.
You should now be able to use TGUI.
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.