Skocz do zawartości

[c++;allegro5]problem z kompilacją programu z Allegro 5


sazian

Polecane posty

Witam,

postanowiłem pobawić się trochę allegro, wybrałem wersję piątą (właściwie jest to 4.9 ale oficjalnie nazywana piątą :) )

zainstalowałem allegro zgodnie z poradnikiem

http://wiki.allegro.cc/index.php?title=Ins...Getting_Allegro

zacząłem pisać program zgodnie poradnikiem

http://wiki.allegro.cc/index.php?title=Tut...d_Display_Modes

napisałem tyle

 
#include <allegro5/allegro5.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <stdio.h>

       struct Data {
               ALLEGRO_FONT *f1, *f2;
               ALLEGRO_DISPLAY *display;
               ALLEGRO_EVENT_QUEUE *queue;

               ALLEGRO_COLOR bright_green;
       } data;

int main()
{
   al_init();
       al_init_font_addon();
       data.display = al_create_display(640, 480);
       if(!data.display) {
               printf("Error creating display.\n");
               return 1;
       }

}

i już ten kod daje mi takiego ładnego babola

wynik polecenia gcc main.cpp -o hello1 `allegro-config --libs`

CYTAT/tmp/ccl3Eszj.o: In function `main':

main.cpp:(.text+0xe): undefined reference to `al_install_system'

main.cpp:(.text+0x13): undefined reference to `al_init_font_addon'

main.cpp:(.text+0x22): undefined reference to `al_create_display'

/tmp/ccl3Eszj.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

a przy próbie użycia polecenia podanego w tutorialu

gcc main.cpp -o hello1 -allegro_ttf-4.9.18 -allegro_font-4.9.18 \ `allegro-config --libs`

dostaje

gcc: -L/usr/lib: No such file or directory

cc1plus: error: unrecognized command line option "-allegro_ttf-4.9.18"

cc1plus: error: unrecognized command line option "-allegro_font-4.9.18"

 

wie może ktoś co tu jest grane i jak to naprawić ??

 

edit:

problem rozwiązany

gcc main.cpp -o hello1 -lallegro_ttf-4.9.18 -lallegro_font-4.9.18 -lallegro-4.9.18 `allegro-config --libs`

Link do komentarza
Udostępnij na innych stronach

Zarchiwizowany

Ten temat jest archiwizowany i nie można dodawać nowych odpowiedzi.

×
×
  • Utwórz nowe...