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.
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.
allegro.h doesn't exist because that is allegro version 4. It's <code>#include "allegro5/allegro.h" now. Look at the wiki tutorials for A5.
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.
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.
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?
Googling Unwind_Resume mentions android and Darwin. Maybe you grabbed the wrong libraries? The Online User page says you're using windows 7.
-static-libgcc
is this the correct input for "other linker options"?
||=== 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.
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?
I didn't say your MinGW was broken, I said the versions were mis-matched. So yeah, you need versions compiled with 4.8.1 which don't exist yet. So either use MinGW 4.7.0 or compile Allegro 5 yourself.