Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: ie8 en 17 Enero 2011, 22:14 pm



Título: Allegro.h en C::B y Mingw
Publicado por: ie8 en 17 Enero 2011, 22:14 pm
Hola, estoy utilizando el IDE Code::Blocks en su última versión, utilizo el compilador Mingw. Quiero probar e iniciarme con allegro.h, pero no he conseguido instalarlo correctamente para poder usarlo.

Me he descargado allegro.h
http://sourceforge.net/projects/alleg/files/allegro-unstable/4.9.22/allegro-4.9.22.zip/download

4.9.22 ya que la más reciente es una Beta y no me fiaba. Lo que hago para instalarlo es ir a la ruta donde está Mingw y copiar todos los archivos que estan en include en el archivo que me baje al include del compilador.

Vi en otros tutoriales que también copiaba los archivos lib del zip que me baje, pero el tutorial era para otra versión.

Está mal instalado porque al probar el código que pongo mas abajo me salta muchisimos errores, en los .h que inclue allegro.

El código:
Código:
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
int main()
{
allegro_init();
install_keyboard();
if (set_gfx_mode(GFX_AUTODETECT,320,200,0,0)<0)
{
printf("error al iniciar modo grafico\n");
allegro_exit();
exit(-1);
}
textout(screen, font, "Mi primer programa", 0, 0, 15);
readkey();
allegro_exit();
return 0;
}

Errores que me da:

Citar
||=== ppppppppppppppppppp, Debug ===|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|36|error: allegro/platform/alplatf.h: No such file or directory|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|66|error: #error platform not supported|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\platform\astdint.h|44|error: #error I dunno how to get the definitions of fixed-width integer types on your platform. Please report this to your friendly Allegro developer.|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|381|error: #error endianess not defined|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|401|error: expected ')' before 'addr'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|401|error: expected ')' before 'addr'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|411|error: expected ')' before 'addr'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\internal\alconfig.h|411|error: expected ')' before 'addr'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\fixed.h|28|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\fixed.h|30|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fixtorad_r'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\fixed.h|31|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'radtofix_r'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\3d.h|33|error: expected specifier-qualifier-list before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\3d.h|73|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\3d.h|73|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\3d.h|76|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'polygon_z_normal'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|208|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|219|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\gfx.h|219|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|58|error: expected declaration specifiers or '...' before '*' token|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|58|error: 'uintptr_t' declared as function returning a function|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: 'bmp_write_line' declared as function returning a function|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: 'bmp_write_line' declared as function returning a function|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'bmp_write_line':|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: '_BMP_BANK_SWITCHER' undeclared (first use in this function)|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: (Each undeclared identifier is reported only once|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: for each function it appears in.)|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|62|error: expected ';' before 'switcher'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|69|error: 'bmp_read_line' declared as function returning a function|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|69|error: 'bmp_read_line' declared as function returning a function|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'bmp_read_line':|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|69|error: '_BMP_BANK_SWITCHER' undeclared (first use in this function)|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|69|error: expected ';' before 'switcher'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|50|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|50|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|51|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|51|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|63|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|64|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|65|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|65|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|66|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|66|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|67|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|68|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|69|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|69|error: expected declaration specifiers or '...' before 'fixed'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\draw.h|70|error: expected declaration specifiers or '...' before 'fixed'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

Con Dev C C++, y con el actualizador suyo instale allegro errores:
(http://img97.imageshack.us/img97/6559/capturanv.png)