Error Linking TGUI 0.10 with SFML-OpenGL3 backend under VS 2015

Started by rherzog, 21 July 2022, 14:23:43

rherzog

Hi, I cannot get TGUI 0.10 running with the SFML OpenGL3 backend under Visual Studio 2015. It runs with the SFML graphics backend though. I use the recommended precompiled freetype libraries (version 2.10.4) and the SFML 2.5.1 libs for Visual Studio 2015. After cmake configuration I build TGUI as shared lib (also tried static lib), which compiles successfully for debug and release configuration. Also building the minimal Opengl3 example with TGUI and SFML seems to work. However, when starting the application an error message is thrown that "FT_Done_Glyph" could not be located in the dynamic link library tgui.dll. I already tried various configurations and always get this error, which seems to come from the freetype library. I would greatly appreciate any help.

texus

Are you linking dynamically to freetype? Do you also get this error when the freetype dll is present next to the exe?

I have build TGUI with the same libraries, can you check if you also get the problem when replacing your TGUI files with the ones from https://www.dropbox.com/s/mz8okpedfj1hlo2/TGUI-0.10-dev-VS2015-SFML2.5.1-FreeType2.10.4.zip?dl=1 ?

rherzog

O.k. sorry, I did not say that I compiled it to x64 target. The ones you gave me in the dropbox are 32bit libs.


rherzog

Unfortunately, I still get the same error when running the minimal application example for the SFML-Opengl backend with dynamic linked libraries.

texus

Can you share your Visual Studio project that is giving you this error?

rherzog


rherzog

O.k., here is the minimal VS 2015 project that produces this error. The environment variables $(SFML_PATH) and $(TGUI_PATH) point to the SFML 2.5.1 and TGui 0.10 libs respectively and were precompiled with v140 compiler (x64). The TGui lib is the one you have given to me earlier. I get the dll error message shown in the attachment.

texus

I just tried replacing my project file with yours and correcting the paths to TGUI and SFML and it still worked fine here. (I only had to remove some extra libs you were linking to in release mode, but those can't be the issue because they weren't linked to in debug mode)

Those are the binaries I generated, does this run on your system?
https://www.dropbox.com/s/po1arrgrto0pdsy/testTGUI_Opengl_sfml_VS2015_x64-bin.zip?dl=1

Try copying all dlls from those binaries next to what you are generating and see if that changes anything.

The only difference between your system and mine that I can think of is the Visual Studio version. I'm using VS2022 with the v140 compiler, while I assume you are still using Visual Studio 2015 directly. While it shouldn't make a difference, it is possible that this is part of the problem. Is there a reason why you still need to use VS2015?

rherzog

O.k. that solved the issue. The problem was that the dlls had to be located in the same folder as the compiled executable. And Visual Studio 2015 does not seem to parse my environment settings for debugging PATH=%PATH%;$(SFML_PATH)\bin;$(TGUI_PATH)\bin, although it is evaluated correctly. And I already copied the TGUI and SFML dlls but not the freetype dll, which was missing. I still don't know why it complained about the TGUI dll and not the missing freetype. But anyways it runs now, thank you a lot!