[RESOLVIDO]Instalar biblioteca allegro(GNU GCC compiler, windows 7 e code::blocks). Como faço?

5 respostas
D

Baixei a bíblioteca, mais não consigo usala. Fiz isto mesmo na faculdade e deu certo, a única coisa que acho chato mesmo em programação é configurar, eu já olhei em 5 foruns e já tentei usar 20 turoriais diferentes, mais simplesmente não consigo usar o allegro.

#include <allegro.h>

int main ()
{
    allegro_init();
    install_keyboard();
    set_color_depth(32);
    set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800,600,0,0);
    while(!key[KEY_ESC])
{
       line(screen, 0,0, 800,600, makecol(0,255,0 ));
       line(screen, 0,600, 800,0, makecol(0,255,0 ))
;}
    return 0;
}
    END_OF_MAIN();

Se quiserem ver os erros:

||=== sdadsa, Debug ===|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void moveBall()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|80|error: 'acquire_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|81|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|81|error: 'circlefill' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|83|error: 'draw_sprite' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|84|error: 'release_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void p1Move()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|104|error: 'acquire_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|105|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|105|error: 'rectfill' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|107|error: 'release_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void p2Move()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|125|error: 'acquire_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|126|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|126|error: 'rectfill' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|128|error: 'release_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void startNew()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|136|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|136|error: 'clear_to_color' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void checkWin()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|151|error: 'font' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|151|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|151|error: 'textout_ex' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|154|error: 'font' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|154|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|154|error: 'textout_ex' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl||In function 'void setupGame()':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|162|error: 'acquire_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|163|error: 'makecol' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|163|error: 'rectfill' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|165|error: 'circlefill' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|166|error: 'draw_sprite' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|167|error: 'release_screen' was not declared in this scope|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|6|error: redefinition of 'int ball_x'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|6|error: 'int ball_x' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|7|error: redefinition of 'int ball_y'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|7|error: 'int ball_y' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|9|error: redefinition of 'int ball_tempX'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|9|error: 'int ball_tempX' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|10|error: redefinition of 'int ball_tempY'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|10|error: 'int ball_tempY' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|12|error: redefinition of 'int p1_x'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|12|error: 'int p1_x' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|13|error: redefinition of 'int p1_y'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|13|error: 'int p1_y' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|15|error: redefinition of 'int p1_tempX'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|15|error: 'int p1_tempX' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|16|error: redefinition of 'int p1_tempY'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|16|error: 'int p1_tempY' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|18|error: redefinition of 'int p2_x'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|18|error: 'int p2_x' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|19|error: redefinition of 'int p2_y'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|19|error: 'int p2_y' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|21|error: redefinition of 'int p2_tempX'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|21|error: 'int p2_tempX' previously defined here|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\allegro\inline\gfx.inl|22|error: redefinition of 'int p2_tempY'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

5 Respostas

douglaskd

Uma vez eu instalei no DevC, tive que compilar a biblioteca, mais foi simples e funcionou normal (Window XP + DevC + Alegro).

sei que a combinação acima funciona normal.

talvez seja conflito com o Windows 7…, testa com o dev.

D

douglaskd:
Uma vez eu instalei no DevC, tive que compilar a biblioteca, mais foi simples e funcionou normal (Window XP + DevC + Alegro).

sei que a combinação acima funciona normal.

talvez seja conflito com o Windows 7…, testa com o dev.

O Dev C++ é ruim, apesar de não ter de configurar bilhões de coisas(gerenciador de pacotes), o compilador dele é ruim. Prefiro usar o GNU.

E como compilo a biblioteca??? Eu também já tentei só para ver se funciona no dev c++, mais falha também. Talvez seja conflito com windows 7 64 bits, mas se fosse rápido eu já teria encontrado a solução, estou a quase 2 semanas e nada. A única coisa que odeio em programação mesmo é configurar, tutoriais que sempre não funcionam, pesquisar e não ter nada, entre outras coisas.

douglaskd

tem esse download com o allegro compilado, talvez você já deve ter visto, é antigo mais não deve ter muitas diferenças:

http://www.programadoresdejogos.com/download/PDJ_CodeBlocks_Setup.exe

D

douglaskd:
tem esse download com o allegro compilado, talvez você já deve ter visto, é antigo mais não deve ter muitas diferenças:

http://www.programadoresdejogos.com/download/PDJ_CodeBlocks_Setup.exe

Continua com os mesmos erros, não sei o que estou fazendo de errado.

D

http://sites.google.com/a/liesenberg.biz/cjogos/home/software/ambiente-de-desenvolvimento
Poxa, no 25º tutorial deu certo, consegui usar o alegro. : )

Criado 29 de setembro de 2010
Ultima resposta 30 de set. de 2010
Respostas 5
Participantes 2