Can't run a program?
ChaoticCacti

Hello again,

I finally got my program to build correctly! Thanks to you guys. But now, whenever I run it I get this message:

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

It's a separate window that comes up with that written on it, it's not in the console window or the build log.

Here's my code if you need it.

#SelectExpand
1#include <allegro5/allegro.h> 2#include <allegro5/allegro_ttf.h> 3#include <allegro5/allegro_font.h> 4#include <allegro5/allegro_native_dialog.h> 5 6int main() 7{ 8 if(!al_init()) 9 { 10 al_show_native_message_box(NULL, "ERROR!", "Allegro5 settings", "Could not initialize Allegro 5", NULL, NULL); 11 return -1; 12 } 13 14 al_set_new_display_flags(ALLEGRO_WINDOWED | ALLEGRO_RESIZABLE); 15 ALLEGRO_DISPLAY *display = al_create_display(800, 600); 16 al_set_window_position(display, 200, 100); 17 al_set_window_title(display, "ChaoticCactus"); 18 19 if(!display) 20 { 21 al_show_native_message_box(display, "Sample Title", "Display Settings", "Windows cannot display screen", NULL, NULL); 22 return -1; 23 } 24 25 al_init_font_addon(); 26 al_init_ttf_addon(); 27 28 ALLEGRO_FONT *font24 = al_load_font("times.ttf", 24, 0); 29 30 al_clear_to_color(al_map_rgb(0, 0, 0)); 31 32 al_draw_text(font24, al_map_rgb(255, 0, 255), 50, 50, 0, "Hello world, this is 24 point"); 33 34 al_flip_display(); 35 36 al_rest(5.0); 37 38 al_destroy_display(display); 39 40 return 0; 41}

bamccaig

I haven't read your previous threads so I don't really know what troubles you had before. You could add links to this thread back to your other thread(s) for convenience. In any case, Google gave this:

http://stackoverflow.com/a/7751743/149184

Sounds like libraries that you're trying to link with are using incompatible exception handling implementations. I assume you are using an IDE. Perhaps we should have you try to build on the command line? :) Do you know how to do that?

ChaoticCacti

Nope, I don't know how to do that.

And I don't think that the two threads really have much to do about each other, I just wanted to say thanks and that I have another problem.

bamccaig

What IDE and toolchain are you using? Code::Blocks? Dev-C++? MinGW?

Edgar Reynaldo

The error message suggests that you linked to a different version of the C++ library than the one contained in the dll installed on your system / in your executable's directory.

ChaoticCacti

@Bamccaig
I'm using Code::Blocks with MinGW.

@Edgar Reynaldo
I used the files from the Allegro folder inside my CodeBlocks folder (the one with the Codeblocks.exe in it, I'm not sure if that's the directory or not as I'm not accustomed to all the different terms).

bamccaig

The command line should be something like this:

gcc -Wall main.c -Lpath\to\allegro\libs -lallegro-5.0 -lallegro_dialog-5.0 \
        -lallegro_font-5.0 -lallegro_ttf-5.0

(All on one line)

I'm not sure exactly how Allegro 5 is installed in Windows though. :-/ I guess you can give that a try from a command prompt. You may need to tweak the PATH variable a bit to get MinGW visible, depending on how you installed it.

I am inclined to believe that your IDE project settings are messed up though. What type of project did you create in Code::Blocks? And what changes did you make to the project configuration e.g., compiler flags or link libraries?

I wonder if maybe you're using the wrong Allegro binaries for your toolchain. That might explain it too, I suppose.

Edgar Reynaldo
bamccaig said:

I wonder if maybe you're using the wrong Allegro binaries for your toolchain. That might explain it too, I suppose.

+10 pts for bambam...

In other words, make sure the version of the Allegro binaries you are using matches your compiler version.

gcc -v

ChaoticCacti

My GCC is 4.6.1
I downloaded MinGW 4.6.1 (TDM), the only one that matched.
Did I do something wrong?

bamccaig

I have no idea what TDM means, but it seems questionable for sure. :-/ Perhaps you'll have to install a different version of MinGW and matching Allegro binaries.

Alternatively, you could attempt to build Allegro yourself in Windows.

{"name":"1459_oh_god_meme_2_Girls_amp_a_Cup_ewww-s357x319-281267-580.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/3\/93f5ab0cb3dbc7ccbd9b0d4212d0f231.png","w":357,"h":319,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/3\/93f5ab0cb3dbc7ccbd9b0d4212d0f231"}1459_oh_god_meme_2_Girls_amp_a_Cup_ewww-s357x319-281267-580.jpg

You should wait to see if anybody knows what TDM is though before we jump to conclusions. :D

ChaoticCacti

Well, the codeblocks that I installed was 'codeblocks-10.05mingw-setup.exe' does that mean that it uses a pre-installed version of MinGW or will it matter if I install my own version?

bamccaig

If you install your own MinGW then you'll have to configure Code::Blocks either way. I don't know if it will matter that you're using a bundled version. I'd probably uninstall the existing Code::Blocks, install MinGW, and then install a plain version of Code::Blocks and configure it to use my MinGW. Just to be sure that there was no funny business because of the bundled package.

Again, though, I'm not sure that we've really narrowed down the problem yet though... :-/

Append:

According to IRC, the TDM means this redistribution of MinGW: http://tdm-gcc.tdragon.net/. So that might explain why you're having issues using it. :) So yeah, probably best to figure out a different combination of MinGW and Allegro binaries that are compatible. :)

ChaoticCacti

Thanks Bamccaig and Edgar!

Thanks for all the help, unfortunately I couldn't figure out the Code::Blocks so I installed Visual Studio 2010 and it works properly.

I'm glad that the Allegro community is so helpful!

--Cactus

Thread #610123. Printed from Allegro.cc