template boy template boy - 3 months ago 13
C++ Question

Why am I getting a procedure entry point error for this simple C++ code?

I'm writing an SFML game and when I try to run the code this is the error I get:


The procedure entry point
_gxx_personality_v0
could not be located in the dynamic link library
libstdc++-6.dll



I've linked to all the libraries correctly and the include files are correct. I've even tried what other answers suggested by putting the
libstdc++-6.dll
inside the directory of my exectable but still nothing.

Another answer said to put the
MinGW/bin
directory before any other directory in the
PATH
environment variable, which I did as well and it still didn't work.

Note: I get this error only when I try to use SFML code. It runs successfully when I comment it out.

Answer

OK, the note you added tells me that the SFML stuff was compiled with another compiler version/configuration, newer one if memory serves right.

You need to make sure that SFML and your code are compiled by the same compiler (versions/configuration) or at least compatible compiler (versions/configuration).

I see that the latest binary packages of SFML use GCC 4.7, and the latest Code::Blocks (mingw) comes with the TDM GCC 4.7 build, so it might be enough to upgrade Code::Blocks and make sure you use the SFML GCC 4.7 TDM (SJLJ) package (and use the gcc that comes with Code::Blocks, of course).

Otherwise, you should probably install the TDM-GCC 4.7 compiler build manually, or if nothing works, compile SFML yourself.