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

Allegro - linker errors

Ostatnio zmodyfikowano 2008-09-18 09:48
Autor Wiadomość
Jiraiya
Temat założony przez niniejszego użytkownika
Allegro - linker errors
» 2008-09-18 00:20:59
Skopiowalem caly kod z kursu i dev nie chce im skompilowac>l ikner errory wywala:/
zainstalowalem to allegro. NIe robilem projektu tylko nowy plik zrodlowy. jak zrobilem projek to opojawilo sie wszystko ale nie oglem tego zamknac. :(
P-1612
DejaVu
» 2008-09-18 00:29:03
Programy wykorzystujące allegro musisz tworzyć z projektem. Wymagany jest on ze względu na to, że do konsolidatora trzeba dolinkować bibliotekę statyczną, a bez projektu nie jesteś w stanie tego zrobić. Skoro odpada opcja kompilowania samego pliku opisz szerzej problem jaki występuje, gdy masz utworzony plik źródłowy z projektem.

Etap 1. Interesuje mnie czy program się kompiluje i uruchamia
Etap 2. Jeśli program się uruchamia to z jakiej lekcji wziąłeś kod (link lub numer lekcji allegro)
P-1613
Jiraiya
Temat założony przez niniejszego użytkownika
» 2008-09-18 09:10:38
robie projekt pokazuje sie
C/C++
#include <allegro.h>

void init();
void deinit();

int main() {
    init();
   
    while( !key[ KEY_ESC ] ) {
        /* put your code here */
    }
   
    deinit();
    return 0;
}
END_OF_MAIN()

void init() {
    int depth, res;
    allegro_init();
    depth = desktop_color_depth();
    if( depth == 0 ) depth = 32;
   
    set_color_depth( depth );
    res = set_gfx_mode( GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0 );
    if( res != 0 ) {
        allegro_message( allegro_error );
        exit( - 1 );
    }
   
    install_timer();
    install_keyboard();
    install_mouse();
    /* add other initializations here */
}

void deinit() {
    clear_keybuf();
    /* add other deinitializations here */

IU do 8 linijki wkleielm ten kod
C/C++
#include <allegro.h> // to wyciolem
int main() //to tez
{
    allegro_init();
    install_keyboard();
    set_color_depth( 8 );
    set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0 );
    set_palette( default_palette );
    clear_to_color( screen, 48 );
    textout_ex( screen, font, "Witaj w Allegro !", 20, 20, makecol( 255, 0, 255 ), - 1 );
   
    readkey();
   
    allegro_exit();
    return 0;
}
END_OF_MAIN();
//to tez

Wyskoczyly bledy ale sie ich pozbylem
Skompilowalo sie lae  nie moglem zamknac programu po uruchomieniu:/
P-1614
DejaVu
» 2008-09-18 09:48:31
Do skonfigurowanego projektu wkleiłem kod:
C/C++
#include <allegro.h>
int main()
{
    allegro_init();
    install_keyboard();
    set_color_depth( 8 );
    set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0 );
    set_palette( default_palette );
    clear_to_color( screen, 48 );
    textout_ex( screen, font, "Witaj w Allegro !", 20, 20, makecol( 255, 0, 255 ), - 1 );
   
    readkey();
   
    allegro_exit();
    return 0;
}
END_OF_MAIN();

Kompiluje się, uruchamia się, dowolnym klawiszem się zamyka (np. ESC).
P-1615
« 1 »
  Strona 1 z 1