LINUX.ORG.RU

[новичок]пытаюсь подключить allegro

 


0

1

Алоха всем.
итак сабж. выполняю по этой инструкции установку.
все симэйки,мэйки и мэйк инсталлы прошли без проблем.
после пытаюсь проверить работает ли.
копирую вот это и пытаюсь скомпилировать через gcc. после не могу разобраться.
вот выхлоп:

/home/dada/Documents/си# gcc test.c -o test
/tmp/ccqVAaAL.o: In function `main':
test.c:(.text+0x21): undefined reference to `_install_allegro_version_check'
test.c:(.text+0x40): undefined reference to `set_gfx_mode'
test.c:(.text+0x45): undefined reference to `install_keyboard'
test.c:(.text+0x4c): undefined reference to `font'
test.c:(.text+0x53): undefined reference to `screen'
test.c:(.text+0x7b): undefined reference to `textout_ex'
test.c:(.text+0x82): undefined reference to `key'
test.c:(.text+0x8b): undefined reference to `allegro_exit'
collect2: ld returned 1 exit status
накопал в инете вот эту страничку клик там написано вот что :
Solution: These errors appear when you don't have the Allegro library linked. Are you sure you linked it correctly? Go back to Part 4 of the guide and try doing that over. If that doesn't work, maybe you linked the wrong library? Try linking ALL of the libraries that the "allegro-config --libs" outputs. This error also happened to me after I had manually edited the Makefile (which was a bad idea), so I had to start a new project and try again (Part 2 of the guide).
выполняю:
root@dada-HP-Elite-7000-Microtower-PC:/home/dada/Documents/си# allegro-config --libs
-L/usr/lib -Wl,-Bsymbolic-functions -lalleg-4.2.2
как я понимаю,всё у меня установлено.
далее я хочу сделать так как написано здесь,а конкретнее в part 4: Linking the Allegro libraries into the project.
но не получается.
скачал этот kdevelop,но не могу выполнить
 Go to the Libraries tab. Now, we're going to click Add and type in the filename of the Allegro library. But before we do that, we have to know what the filename of the library is. So open up a terminal and type this command, the same command we typed earlier:
allegro-config --libs
нельзя без этого kdevelop обойтись ? нельзя в терминале всё сделать ? так как мне оъяснить gcc что есть новая штучка под названием allegro ?
надеюсь смог объяснить в чём проблема.

выхлоп указанного «allegro-config --libs» надо добавить в строку компилятору - у вас просто библиотеки неподхватываются.

И почитайте что-нить про make - сильно облегчите себе жизнь.

MKuznetsov ★★★★★
()
Ответ на: комментарий от MKuznetsov

да да. вот как сделал и помогло :
gcc test.c -o test `allegro-config --libs`
всё заработало. чуточку ступил.

alikhantara
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.