Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Code::Blocks and Allegro 5

This thread is locked; no one can reply to it. rss feed Print
Code::Blocks and Allegro 5
Zarrey
Member #15,549
March 2014

I am trying to get allegro 5 to work with c::b. i followed this tutorial: http://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5. I have the mingw installed properly with the test at the end of the tutorial. i am getting this error: "B:\Users\Caton\Desktop\Programming Stuff\Projects\Test Allegro\test.cpp|1|fatal error: allegro.h: No such file or directory|"

on a side note, i've linked libraries before in other IDE's such as eclipse and visual studio and I was able to resolve my issues but this is proving to be a bit of a stick in the mud.

pkrcel
Member #14,001
February 2012

Given the error, the compiler is unable to find the correct include directories.

You should:

  • double check you installed Allegro binaries where you think them to be

  • Check the Include path of your compiler as given in C::B...which means quite a few panels (IIRC compiler options and build target options at least), I'd say the C::B Wiki is a good place to look fo info on how to specify the correct include paths.

If those two are okay I'm a bit clueless, but I might ask for the code of this test.cpp since I cannot find one in the tutorial you linked.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Zarrey
Member #15,549
March 2014

when i changed my code to include allegro 5 header files, it now gives me this:

||=== Build: Debug in Test Allegro (compiler: GNU GCC Compiler) ===|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp|| undefined reference to `_Unwind_Resume'|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp|| undefined reference to `_Unwind_Resume'|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp:(.eh_frame+0x63)||undefined reference to `__gxx_personality_v0'|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

i can post the code, but all i did was google a helloworld program for allegro5 to try and test the link.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Undefined references refer to the linker not finding the libraries, not header files, which would give declaration errors.

And the "__gxx_personality_v0" is a C++ thing, IIRC I had to compile programs linked against the monolith library as C++ because some library function used it.

They all watch too much MSNBC... they get ideas.

Zarrey
Member #15,549
March 2014

i thought i included all the necessary static libs in the linker options, i included all the -static-xxxxxxx.a libs in the allegro 5 mingw download on this website. is it missing something that the code i am using is trying to reference?

Arthur Kalliokoski
Second in Command
February 2005
avatar

Googling Unwind_Resume mentions android and Darwin. Maybe you grabbed the wrong libraries? The Online User page says you're using windows 7.

They all watch too much MSNBC... they get ideas.

Zarrey
Member #15,549
March 2014

-static-libgcc

is this the correct input for "other linker options"?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Zarrey said:

||=== Build: Debug in Test Allegro (compiler: GNU GCC Compiler) ===|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp|| undefined reference to `_Unwind_Resume'|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp|| undefined reference to `_Unwind_Resume'|
..\..\Allegro\lib\liballegro-5.0.10-static-mt.a(d3d_display_formats.o):d3d_display_formats.cpp:(.eh_frame+0x63)||undefined reference to `__gxx_personality_v0'|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

These errors usually come from mis-matched versions of the compiler. Make sure your compiler is the same version as the binaries you downloaded.

Zarrey
Member #15,549
March 2014

tested my MinGW installation with this website:

http://www.mingw.org/wiki/Getting_Started

it works like it should. so i know this is not the problem. im about to just say screw it and go back to visual studio and allegro 4 :'(.

does allegro5 not support MinGW 4.8?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

pkrcel
Member #14,001
February 2012

Zarrey said:

does allegro5 not support MinGW 4.8?

Of course it does, Allegro is simply source code, do as Edgar said and compile Allegro yourself, it's easier than it looks.

Siegelord's tutorial is a good starting point, here

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Go to: