program linked to SFML dlls wont start, returns 0xC000007B or missing __gxx_personality_v0

829 Views Asked by At

I was trying to compile example from SFML page http://www.sfml-dev.org/tutorials/2.3/start-cb.php (at the bottom)

I dowloaded the version for GCC 4.9.2 DW2, set everything needed (linker, directories) and it compiled without errors.

When the application starts it says that it needs .dll files so I copied them from SFML/bin directory. Then it says the procedure entry point __gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll (libstdc++-6 is there copied from MinGW/bin)

or the pro... _ZSt24__throw_out_of_range_fmtPKcz in same dll

On the SFML page there is a note:

There are multiple variants of GCC for Windows, which are incompatible with each other (different exception management, threading model, etc.). Make sure you select the package which corresponds to the version that you use. If you are unsure, check which of the libgcc_s_sjlj-1.dll or libgcc_s_dw2-1.dll files is present in your MinGW/bin folder. If MinGW was installed along with Code::Blocks, you probably have an SJLJ version. If you feel like your version of GCC can't work with the precompiled SFML libraries, don't hesitate to build SFML yourself, it's not complicated.

I tried to compile it linked with dw2 and sjlj SFML versions in both DevC++ and Code::Blocks resulting in errors above. I have both dlls in my compilers instalation folders. Is something wrong with my IDEs? I am tired of guessing new IDE/compiler<->SFML_version combinations

Later I tried to build SFML by myself using cmake - when launching .exe with thsese dlls I get error 0xC000007B.

I have tried to link it statically, I added required libraries in the linker in right order but it returns undefined reference to ... many times (in both IDEs).

I just want to make the program run, few days ago I compiled other example using SDL library without any problems, it runs perfectly.

SFML all tries were 32bit and same for compilers

1

There are 1 best solutions below

4
On BEST ANSWER

Due to C++ ABI incompatibility the SFML libraries must be built with the same exact compiler as your application gets built with.

If you don't use this MinGW compiler, you'll have to rebuild SFML by yourself.