![]() |
|
Can't run a program? |
ChaoticCacti
Member #14,241
April 2012
|
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. 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
Member #7,536
July 2006
![]() |
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? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
ChaoticCacti
Member #14,241
April 2012
|
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
Member #7,536
July 2006
![]() |
What IDE and toolchain are you using? Code::Blocks? Dev-C++? MinGW? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
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. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
ChaoticCacti
Member #14,241
April 2012
|
@Bamccaig @Edgar Reynaldo |
bamccaig
Member #7,536
July 2006
![]() |
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 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. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
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 My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
ChaoticCacti
Member #14,241
April 2012
|
My GCC is 4.6.1 |
bamccaig
Member #7,536
July 2006
![]() |
I have no idea what TDM means, but it seems questionable for sure. 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"}
You should wait to see if anybody knows what TDM is though before we jump to conclusions. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
ChaoticCacti
Member #14,241
April 2012
|
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
Member #7,536
July 2006
![]() |
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. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
ChaoticCacti
Member #14,241
April 2012
|
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 |
|