Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Trying Allegro, can't get to compile with CodeBlocks!

This thread is locked; no one can reply to it. rss feed Print
Trying Allegro, can't get to compile with CodeBlocks!
Kreatyve
Member #15,492
February 2014

I tried to compile this example code from the wiki:

#SelectExpand
1#include <iostream> 2 3#define ALLEGRO_STATICLINK 4#include "allegro5\allegro.h" 5#include "allegro5\allegro_image.h" 6#include "allegro5\allegro_primitives.h" 7 8int main(int argc, char **argv) { 9 ALLEGRO_DISPLAY *display = NULL; 10 ALLEGRO_DISPLAY_MODE disp_data; 11 12 al_init(); 13 al_init_image_addon(); 14 al_init_primitives_addon(); 15 16 al_get_display_mode(al_get_num_display_modes() - 1, &disp_data); 17 18 al_set_new_display_flags(ALLEGRO_FULLSCREEN); 19 display = al_create_display(disp_data.width, disp_data.height); 20 21 al_rest(3); 22 al_destroy_display(display); 23 return 0; 24}

And I get this:

Quote:

..\..\..\My Documents\Downloads\allegro\binary-mingw\lib\liballegro-5.0.10-monolith-static-mt.a(gdiplus.o):gdiplus.cpp|| undefined reference to `_Unwind_Resume'|

I followed the guide [1] step-by-step.

I know basic C++ and am trying to create my own MMORPG (I know large task for a beginner but I am doing it for fun.)

Karadoc ~~
Member #2,749
September 2002
avatar

I did a quick internet search for 'undefined reference to `_Unwind_Resume', and I discovered that this problem typically arises when the compiler used to compile the library is not the same version as the compiler used to link the library to the final program.

ie. Perhaps you're using a version of Allegro that doesn't match your version of gcc.

By the way, <code> and <quote> are the tags, rather than [code] and [quote]

-----------

Kreatyve
Member #15,492
February 2014

I will try matching the versions, I did notice that the compiler version is more updated than the Allegro files.
I will update my progress in this post.

Thanks for the BBcode advice.

Go to: