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

2

6

Yesterday I decided to download, install, and attempt to use Allegro 5. I also downloaded Code::Blocks 12.11 w/ the MinGW compiler. I set up everything and installed everything correctly (or so I thought) and tried to run a sample code to see if it would work:

#include <stdio.h>
#include <allegro5/allegro.h>

int main(int argc, char **argv){

   ALLEGRO_DISPLAY *display = NULL;

   if(!al_init()) {
      fprintf(stderr, "failed to initialize allegro!\n");
      return -1;
   }

   display = al_create_display(640, 480);
   if(!display) {
      fprintf(stderr, "failed to create display!\n");
      return -1;
   }

   al_clear_to_color(al_map_rgb(0,0,0));

   al_flip_display();

   al_rest(10.0);

   al_destroy_display(display);

   return 0;
}

When I attempt to compile and run the program an error message box appears saying "The procedure entry point _gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll." I searched the web for about an hour trying to find a fix for this problem, like I do for most things, but I came up empty handed. I'm wondering if anyone has any ideas for any fixes to this problem, if so, let me know ASAP! Thanks in advance!

Hypothyroidism answered 1/7, 2013 at 17:58 Comment(2)
What does gcc -v give you? Does it match the version of Allegro you downloaded?Iterative
Possible duplicate of the procedure entry point __gxx_personality_v0 could not be locatedOscular
R
12

__gxx_personality_v0 is used in the exception handling of the C++ library. MinGW can support a couple different exception models on the x86: sjlj (setjmp/longjmp) or DWARF (DW2). As far as I know, which model will be used is compiled into the compiler - it's not something that can be selected with a command line option.

The sjlj exception model will link to __gxx_personality_sj0, the DW2 exception model links to __gxx_personality_v0. It seems like your compiler is building for the dw2 exception model, but at runtime it's finding a libstdc++-6.dll that was built with the sjlj model. See if you have multiple versions of libstdc++-6.dll on youR system, and see if copying another one to the same directory as your program fixes the problem.

You can use nm libstdc++-6.dll | grep personality to see which exception 'personality' the DLL is using.

Redwood answered 2/7, 2013 at 4:38 Comment(4)
Thanks for the reply! I searched my entire computer and couldn't find any other .dll by that name except for the one that is in the MinGW bin folder. I tried adding it into the project folder and compiling and running, but it still returned that same error:(Hypothyroidism
what does running nm libstdc++-6.dll | grep personality say for it?Redwood
Ah - does this program depend on DLLs that were pre-built (ie., not compiled on your system)? If so, maybe your compiler is sjlj and one or more of those DLLs was build expecting dw2 exception handling. You might need to build all libraries yourself, or get alternative libraries build to match the exception handling for your compiler (or maybe switch MinGW compilers to one that uses dw2 exception handling).Redwood
i'm running nm libstdc++-6.dll it said no such file, what that supposed to be mean? i aleady put the file at windows/system32Particularize
S
1

I ran into this as well. Did some searching, someone mentioned paying attention to whether or not you were in Debug or Release Mode. This applies to Code::Blocks specifically. I found I was in Debug Mode. I changed that to Release Mode and my program compiled and ran.

I am troubled by this though... It seems to me it should work in both modes, so how do I fix it so that it will? I have no answer there. Maybe someone will comment with the solution. In the meantime, compile and run in Release Mode instead of Debug Mode.

I just did a little mad science, removed the libstdc++6.dll from MinGW/bin and put it in another folder. Then I copied over the same file from Gimp/bin. No more linker error, instead I get an error that says the application failed to start :( Still compiles and runs in Release Mode though.

Server answered 19/2, 2014 at 23:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.