Finally reinstalled allegro, devcpp and all that put the -lalleg in its proper place, linked the liballeg.a to the project, did a full compile and...
boom, pretty big error that came out, all the while insisting that my
#include <allegro.h> line is the culprit, just when I thought the compiler and me could get along...
this is the error:
| 1 | Compiler: Default compiler |
| 2 | Building Makefile: "C:\DevCpp\Programacion en C\cutrejuego(1)\Makefile.win" |
| 3 | Executing make clean |
| 4 | rm -f base.o codigoextra.o Proyecto1.exe |
| 5 | |
| 6 | g++.exe -c base.cpp -o base.o -I"C:/DevCpp/include/c++" -I"C:/DevCpp/include/c++/mingw32" -I"C:/DevCpp/include/c++/backward" -I"C:/DevCpp/include" |
| 7 | |
| 8 | In file included from C:/DevCpp/include/allegro.h:25, |
| 9 | from base.cpp:1: |
| 10 | C:/DevCpp/include/allegro/base.h:85: type specifier omitted for parameter ` |
| 11 | allegro_errno' |
| 12 | C:/DevCpp/include/allegro/base.h:85: ISO C++ forbids declaration of `AL_VAR' |
| 13 | with no type |
| 14 | |
| 15 | In file included from C:/DevCpp/include/allegro/system.h:23, |
| 16 | from C:/DevCpp/include/allegro.h:27, |
| 17 | from base.cpp:1: |
| 18 | C:/DevCpp/include/allegro/unicode.h:34: type specifier omitted for parameter ` |
| 19 | set_uformat' |
| 20 | C:/DevCpp/include/allegro/unicode.h:34: parse error before `int' |
| 21 | C:/DevCpp/include/allegro/unicode.h:34: ISO C++ forbids declaration of `AL_FUNC |
| 22 | ' with no type |
| 23 | C:/DevCpp/include/allegro/unicode.h: In function `int AL_FUNC(...)': |
| 24 | C:/DevCpp/include/allegro/unicode.h:35: type specifier omitted for parameter ` |
| 25 | get_uformat' |
| 26 | |
| 27 | |
| 28 | **********LOTS AND LOTS OF LINES (all similar to the ones above and below) Like 154 pages of size 14 letters***** |
| 29 | |
| 30 | C:/DevCpp/include/allegro/system.h:95: type specifier omitted for parameter ` |
| 31 | set_close_button_callback' |
| 32 | C:/DevCpp/include/allegro/system.h:95: type specifier omitted for parameter ` |
| 33 | proc' |
| 34 | C:/DevCpp/include/allegro/system.h:95: parse error before `void' |
| 35 | C:/DevCpp/include/allegro/system.h:95: type specifier omitted for parameter ` |
| 36 | Internal compiler error: Error reporting routines re-entered. |
| 37 | Please submit a full bug report, |
| 38 | with preprocessed source if appropriate. |
| 39 | See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. |
| 40 | make.exe: *** [base.o] Error 1 |
| 41 | |
| 42 | Execution terminated |
Any bright ideas why I get more than 150 pages of errors?
g++.exe -c base.cpp -o base.o -I"C:/DevCpp/include/c++" -I"C:/DevCpp/include/c++/mingw32" -I"C:/DevCpp/include/c++/backward" -I"C:/DevCpp/include"
Where is your -lalleg call?
Tools / compiler options / "add the folowing comands when calling compiler" box
Thats where I put it.
Maybe that option doesn't work. Most things don't work properly in DevC++. Try adding it to usual place.
Whats the usual place ? I dont rember where I put it last time I installed ^^'
Pray tell
This is a compiling error, not a linking error. Stop messing about and show us base.cpp please.
Pete
Well, wish it were, but the code worked fine and smooth the very day before I formated my computer, afther formating I've reinstaled everything and now not only it doesnt work, but it gives this weird error, and I still ahvent touched the my code. But If you think I'd help, here it is:
| 1 | #include <allegro.h> |
| 2 | #include "interfaz_clases.h" |
| 3 | #include <time.h> |
| 4 | |
| 5 | BITMAP *raton, *buffer, *del_mapa, *fondo_mapa, *el_muro, *la_caja, *mapa_pj, *dibu_bomba, *dibu_fuego; |
| 6 | PALETTE palette; |
| 7 | |
| 8 | void iniciartodo(); |
| 9 | void salir(); |
| 10 | bool done = false; |
| 11 | |
| 12 | volatile int tiempo1 = 0; |
| 13 | void ticker(void) |
| 14 | { |
| 15 | tiempo1=1; |
| 16 | } |
| 17 | END_OF_FUNCTION(ticker) |
| 18 | |
| 19 | void iniciartodo() |
| 20 | { |
| 21 | allegro_init(); |
| 22 | install_keyboard(); |
| 23 | install_mouse(); |
| 24 | set_color_depth(32); |
| 25 | set_gfx_mode(GFX_AUTODETECT, 1024, 768, 0, 0); |
| 26 | |
| 27 | install_timer(); |
| 28 | LOCK_FUNCTION(ticker); |
| 29 | LOCK_VARIABLE(tiempo1); |
| 30 | install_int_ex(ticker, BPS_TO_TIMER(15)); |
| 31 | |
| 32 | |
| 33 | srand ( time(NULL) ); /* initialize random generator */ |
| 34 | |
| 35 | buffer = create_bitmap(SCREEN_W, SCREEN_H); |
| 36 | raton = create_bitmap(SCREEN_W, SCREEN_H); |
| 37 | clear(buffer); |
| 38 | clear_to_color(raton, makecol(255, 0, 255)); |
| 39 | |
| 40 | del_mapa = create_bitmap(map_w * tam_celda, map_h * tam_celda); //crea el bitmap del_mapa |
| 41 | clear_to_color(del_mapa, makecol(255, 0, 255)); // y lo limpia a transparente |
| 42 | |
| 43 | mapa_pj = create_bitmap(map_w * tam_celda, map_h * tam_celda); |
| 44 | clear_to_color(mapa_pj, makecol(255, 0, 255)); |
| 45 | |
| 46 | fondo_mapa = create_bitmap(map_w-1 * tam_celda, map_h-1 * tam_celda); //Crea el bitmap del fondo del mapa |
| 47 | //clear_to_color(fondo_mapa, makecol(255, 0, 255)); //Porque no funciona el clear? da error de ejcucion |
| 48 | fondo_mapa = load_bitmap("imagenes/fondo.pcx", palette); //y carga la imagen del fondo |
| 49 | |
| 50 | el_muro = create_bitmap(tam_celda,tam_celda); |
| 51 | clear_to_color(el_muro, makecol(255, 0, 255)); |
| 52 | el_muro = load_bitmap("imagenes/muro.pcx", palette); |
| 53 | |
| 54 | la_caja = create_bitmap(tam_celda,tam_celda); |
| 55 | clear_to_color(la_caja, makecol(255, 0, 255)); |
| 56 | la_caja = load_bitmap("imagenes/caja.pcx", palette); |
| 57 | |
| 58 | dibu_bomba = create_bitmap(tam_celda,tam_celda); |
| 59 | clear_to_color(dibu_bomba, makecol(255, 0, 255)); |
| 60 | dibu_bomba = load_bitmap("imagenes/bomba.pcx", palette); |
| 61 | |
| 62 | |
| 63 | show_mouse(raton); |
| 64 | |
| 65 | } |
| 66 | |
| 67 | |
| 68 | void salir() { if (key[KEY_ESC]) done = true;} |
| 69 | |
| 70 | int main() |
| 71 | { |
| 72 | iniciartodo(); |
| 73 | mapa.crear_mapa(); |
| 74 | player1.crear_pj(); |
| 75 | |
| 76 | while (!done) |
| 77 | { |
| 78 | clear(buffer); |
| 79 | player1.moverse(); |
| 80 | player1.poner_bomba(); |
| 81 | |
| 82 | mapa.dibujar_mapa(); |
| 83 | player1.dibujarse(); |
| 84 | draw_sprite(buffer, raton,0,0); |
| 85 | blit(buffer, screen,0,0,0,0,SCREEN_W,SCREEN_H); |
| 86 | |
| 87 | salir(); |
| 88 | } |
| 89 | |
| 90 | mapa.destruir_mapa(); |
| 91 | destroy_bitmap(raton); |
| 92 | destroy_bitmap(buffer); |
| 93 | return 0; |
| 94 | } |
| 95 | END_OF_MAIN() |
RP: He doesn't need -lalleg for that portion because he's not linking, just compiling to an object file.
Now, what is this base.h that allegro.h is including?
[edit]
It seems it thinks its a compiler bug?
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make.exe: *** [base.o] Error 1

I got the same error one time compiling wxWidgets, and upgrading my gcc fixed it.