问题
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 librarylibstdc++-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.
回答1:
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.
回答2:
This is just a PATH ordering issue.
Most likely you'll have multiple libstdc++-6.dll files loaded in your path. You can check by running where libstdc++-6.dll
in your command prompt.
What you do is to make sure your MinGW bin folder is loaded before everything else. Try moving it to the first one in your global PATH.
来源:https://stackoverflow.com/questions/24212090/why-am-i-getting-a-procedure-entry-point-error-for-this-simple-c-code