SFML community forums

Help => General => Topic started by: Kraken on July 07, 2023, 06:07:45 pm

Title: Dynamic linking error at runtime, "entry point could not be located"
Post by: Kraken on July 07, 2023, 06:07:45 pm
I successfully compiled the example program with g++ on windows 11, but when I run the program, I get a popup window with this message:

the procedure entry point _ZSt28__throw_bad_array_new_lenghtv could not be located in the dynamic link library "C:\SFML-projects\template\sfml-window-2.dll"

SFML-projects\template is my project folder, and I copied all the .dll files there.

I am using MinGW 32, and the "SFML-2.6.0-windows-gcc-13.1.0-mingw-32-bit" package from the downloads page.

How do I fix this?
Title: Re: Dynamic linking error at runtime, "entry point could not be located"
Post by: eXpl0it3r on July 07, 2023, 08:50:04 pm
Did you happen to skillfully scroll past the red box on the download page that says:

Quote
Unless you are using a newer version of Visual Studio, the compiler versions have to match 100%!
Here are links to the specific MinGW compiler versions used to build the provided packages:
WinLibs MSVCRT 13.1.0 (32-bit) (https://github.com/brechtsanders/winlibs_mingw/releases/download/13.1.0-16.0.5-11.0.0-msvcrt-r5/winlibs-i686-posix-dwarf-gcc-13.1.0-mingw-w64msvcrt-11.0.0-r5.7z), WinLibs MSVCRT 13.1.0 (64-bit) (https://github.com/brechtsanders/winlibs_mingw/releases/download/13.1.0-16.0.5-11.0.0-msvcrt-r5/winlibs-x86_64-posix-seh-gcc-13.1.0-mingw-w64msvcrt-11.0.0-r5.7z)

? ;D

If you want to use your own compiler, then you can do so by for example using the SFML CMake template (https://github.com/SFML/cmake-sfml-project), or just build SFML from source.
Title: Re: Dynamic linking error at runtime, "entry point could not be located"
Post by: Kraken on July 07, 2023, 11:48:19 pm
Wait, what do you mean? I'm using MinGW 32bit and that's the exact package I'm using. What am I missing?
Title: Re: Dynamic linking error at runtime, "entry point could not be located"
Post by: eXpl0it3r on July 08, 2023, 12:36:16 am
The part about "the compiler versions have to match 100%". There are lots and lots of different MinGW distributions out there. It's not good enough to just pick one at random.

If you want to use the pre-built binaries from the download page you have to use the compilers linked in the quote box.
Title: Re: Dynamic linking error at runtime, "entry point could not be located"
Post by: Kraken on July 10, 2023, 05:55:19 pm
Ah, I understand now.
I've decided to switch to visual studio instead and it is working perfectly, thank you for the help.