SFML community forums

Help => General => Topic started by: binomial0 on June 22, 2016, 12:34:48 pm

Title: SFML examples incompatible to dlls
Post by: binomial0 on June 22, 2016, 12:34:48 pm
Hello,

I was trying to compile SFML myself, but my binaries were always incompatible to the SFML dlls.
Finally, I compiled the SFML examples, only to find that even they are incompatible. That's really weird, because they were compiled in one go with the dlls, which should guarantee that the same compiler and configuration was used.
Can anyone help me finding out what causes that problem, thus hopefully getting my actual project to work?

Thank you

Technical details: Win10 Pro x64, SFML 2.3.2, MinGW gcc 4.9.3, cmake 3.6.0-rc2, in PATH: MinGW/bin; cmake/bin; sfml/bin (with dlls), tried both static and dynamic sfml builds (neither works)
Error when linking statically: Procedure entry point "_ZSt24__throw_out_of_range_fmtPKcz" not found in the dll "C:\Program Files (x68)\SFML\examples\pong\pong-d.exe"
Error when linking dynamically: Procedure entry point "_ZSt24__throw_out_of_range_fmtPKcz" not found in the dll "C:\Program Files (x68)\SFML\bin\sfml-system-d-2.dll"
Title: Re: SFML examples incompatible to dlls
Post by: Mario on June 22, 2016, 06:59:56 pm
Any chance you're compiling with gcc rather than g++?
Title: Re: SFML examples incompatible to dlls
Post by: binomial0 on June 22, 2016, 07:24:09 pm
No, because compiling still works when I remove the gcc binary. Apart from that, this shouldn't be an issue because I only use cmake and mingw32-make directly, so they should automatically invoke the right compiler.
Title: AW: SFML examples incompatible to dlls
Post by: eXpl0it3r on June 22, 2016, 09:18:15 pm
It's an error when trying to load the symbols from the DLL, this means that your application and the libraries aren't compatible.

Did you copy the right DLLs to the right place? Are there other DLLs in PATH?
Title: Re: SFML examples incompatible to dlls
Post by: binomial0 on June 22, 2016, 11:18:15 pm
I am pretty sure I handled the dlls correctly. However, I just tried to link the examples statically (pretty sure I tried it before), and now it worked... I still find this pretty strange, but I assume it was some stupid error on my side. Sorry for that, and thanks for all the kind support! (You really eased the frustration I experienced before...)

As a summary for those who share my problem: in cmake-gui, uncheck BUILD_SHARED_LIBS, and check SFML_USE_STATIC_STD_LIBS. This got the examples working on my machine.
Title: Re: SFML examples incompatible to dlls
Post by: Laurent on June 22, 2016, 11:41:26 pm
Quote
uncheck BUILD_SHARED_LIBS, and check SFML_USE_STATIC_STD_LIBS
Are both really needed?