Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

[C++/Allegro] Problem

Ostatnio zmodyfikowano 2012-01-01 15:05
Autor Wiadomość
Trotom
Temat założony przez niniejszego użytkownika
[C++/Allegro] Problem
» 2012-01-01 14:40:54
Trochę już programuję, ale zaczynają mnie ograniczać granice konsoli. Chciałbym nauczyć się programowania Allegro, jednak Viusal Studio C++ 2010 (oraz wcześniej Dev-Cpp) wykazują następujący błąd przy kompilacji:
------ Build started: Project: allegro, Configuration: Debug Win32 ------
  kod_allegro.cpp
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(6): error C3861: 'allegro_init': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(7): error C3861: 'install_keyboard': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(9): error C2065: 'GFX_AUTODETECT_WINDOWED' : undeclared identifier
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(9): error C3861: 'set_gfx_mode': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(11): error C2065: 'screen' : undeclared identifier
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(11): error C3861: 'triangle': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(11): error C3861: 'makecol': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(12): error C2065: 'screen' : undeclared identifier
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(12): error C3861: 'circlefill': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(12): error C3861: 'makecol': identifier not found
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(14): error C2065: 'key' : undeclared identifier
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(14): error C2065: 'KEY_ESC' : undeclared identifier
c:\documents and settings\tom\moje dokumenty\visual studio 2010\projects\allegro\allegro\kod_allegro.cpp(14): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
A używam takiego kodu:
C/C++
#define USE_CONSOLE
#include "allegro5/allegro5.h"

int main()
{
    allegro_init();
    install_keyboard();
   
    set_gfx_mode( GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0 );
   
    triangle( screen, 320, 40, 147, 340, 493, 340, makecol( 255, 0, 0 ) );
    circlefill( screen, 320, 240, 100, makecol( 255, 255, 255 ) );
   
    while( !key[ KEY_ESC ] )
        ;
   
    return 0;
}

END_OF_MAIN();
Proszę o pomoc.

EDIT: Dodam, że szukałem na wielu forach. I polskich, i angielskich.
P-46903
Gabes
» 2012-01-01 14:46:09
#include <allegro.h>     to allegro4
Już ktoś na forum ten kod pokazywał

C/C++
#include <allegro.h>
int main()
{
    allegro_init();
    install_keyboard();
    set_color_depth( 32 );
    set_gfx_mode( GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0 );
    BITMAP * bufor = create_bitmap( 800, 600 );
    while( !key[ KEY_ESC ] )
    {
        clear_to_color( bufor, makecol( 100, 100, 100 ) );
        textprintf_ex( bufor, font, 40, 40, makecol( 0, 255, 255 ), - 1,
        "Witaj w Allegro %s ", ALLEGRO_VERSION_STR " !" );
        blit( bufor, screen, 0, 0, 0, 0, 800, 600 );
    }
    destroy_bitmap( bufor );
    allegro_exit();
    return 0;
}
END_OF_MAIN();
P-46907
SeaMonster131
» 2012-01-01 14:47:05
Używasz Allegro5 a masz kod programu do Allegro4 to sie nie dziw, że nie działa :P
kurs Allegro5
P-46908
Trotom
Temat założony przez niniejszego użytkownika
» 2012-01-01 14:59:44
Dzięki, mieliście rację, ale ten poradnik jest błędny. Po poprawieniu headers'ów (moje zamiast a5 nazywały się allegro) zaczęły wyskakiwać błędy, że ilość argumentów jest zła. Ponieważ nie znam się na tym wolałem nie poprawiać.
P-46909
Trotom
Temat założony przez niniejszego użytkownika
» 2012-01-01 15:00:34
Sorry za dubleposta, internet mi się zaciął. Jeszcze raz dzięki.
P-46910
SeaMonster131
» 2012-01-01 15:05:18
zaczęły wyskakiwać błędy, że ilość argumentów jest zła. Ponieważ nie znam się na tym wolałem nie poprawiać.
dokumentacja

Jak problem rozwiązany to zamykam.
P-46911
« 1 »
  Strona 1 z 1