Since the SFML code is unlikely to be broken, and neither TGUI or your project is making OpenGL calls that could interfere with SFML, this does sound like some library incompatibility.
So you will indeed either need to learn how to compile SFML and TGUI, or alternatively learn how to change the compiler in CodeBlocks and downgrade the GCC version.
So you will indeed either need to learn how to compile SFML and TGUI, or alternatively learn how to change the compiler in CodeBlocks and downgrade the GCC version.

