Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » installing on linux mandrake 8.1

This thread is locked; no one can reply to it. rss feed Print
installing on linux mandrake 8.1
kjus
Member #2,433
June 2002

hello,
I'm french and new to allegro.
I would want to install allegro on linux.
I've downloaded the precompiled linux version (rpm), installed it.
But when i'm compiling with gcc :
gcc myfile.c -o myprogram `allegro-config --libs`

all the functions specific to allegro comes with errors (undeclared ientifier), like I didn't installed the library. :o
What's the problem.?
If you need more details to help me just ask...
raph

kerick
Member #365
May 2000
avatar

I think it should be
gcc myfile.c -o myprogram -lalleg
but I'm not sure

maybe thats only in dos

Project %:10% --Pre-Alpha

gosam
Member #1,886
February 2002
avatar

maybe you've simply forgot to #include <allegro.h>???

Matthew Leverton
Supreme Loser
January 1999
avatar

Please supply the actual error message.

Did you remember to use END_OF_MAIN() immediately after the closing brace of the main() function?

kjus
Member #2,433
June 2002

I didn't forgot #include <allegro.h> neither END_OF_MAIN(); (i've checked, and also my source compils well on windows with dev-c++)
here is my errors typing gcc kpong.cpp -o kponglinux `allegro--config -lib` :
kpong.cp : in fonction `int _mangled_main()' :
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
/tmp/ccJ9wK5d.o: In function `_mangled_main(void)':
/tmp/ccJ9wK5d.o(.text+0x3b): undefined reference to `install_allegro'
/tmp/ccJ9wK5d.o(.text+0x43): undefined reference to `install_keyboard'
/tmp/ccJ9wK5d.o(.text+0x48): undefined reference to `install_mouse'
/tmp/ccJ9wK5d.o(.text+0x54): undefined reference to `install_mouse'
/tmp/ccJ9wK5d.o(.text+0x61): undefined reference to `allegro_error'
/tmp/ccJ9wK5d.o(.text+0x6b): undefined reference to `allegro_message'
/tmp/ccJ9wK5d.o(.text+0x86): undefined reference to `set_color_depth'
/tmp/ccJ9wK5d.o(.text+0xa1): undefined reference to `set_gfx_mode'
/tmp/ccJ9wK5d.o(.text+0xba): undefined reference to `set_gfx_mode'
/tmp/ccJ9wK5d.o(.text+0xc5): undefined reference to `allegro_error'
/tmp/ccJ9wK5d.o(.text+0xcf): undefined reference to `allegro_message'
/tmp/ccJ9wK5d.o(.text+0xeb): undefined reference to `load_bitmap'
/tmp/ccJ9wK5d.o(.text+0x100): undefined reference to `load_bitmap'
/tmp/ccJ9wK5d.o(.text+0x115): undefined reference to `load_bitmap'
/tmp/ccJ9wK5d.o(.text+0x12a): undefined reference to `load_bitmap'
/tmp/ccJ9wK5d.o(.text+0x142): undefined reference to `create_bitmap'
/tmp/ccJ9wK5d.o(.text+0x157): undefined reference to `clear_bitmap'
/tmp/ccJ9wK5d.o(.text+0x16b): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x1c4): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x1e7): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x219): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x232): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x282): more undefined references to `screen' follow
/tmp/ccJ9wK5d.o: In function `_mangled_main(void)':
/tmp/ccJ9wK5d.o(.text+0x392): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x3b7): undefined reference to `clear_bitmap'
/tmp/ccJ9wK5d.o(.text+0x3bf): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x3c9): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x42a): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x485): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x48e): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x4ca): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x577): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x587): more undefined references to `key' follow
/tmp/ccJ9wK5d.o: In function `_mangled_main(void)':
/tmp/ccJ9wK5d.o(.text+0x591): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x5f2): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x64d): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x656): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x692): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x6a0): undefined reference to `key'
/tmp/ccJ9wK5d.o(.text+0x77d): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x793): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x7bc): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x7d2): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x923): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x936): more undefined references to `screen' follow
/tmp/ccJ9wK5d.o: In function `_mangled_main(void)':
/tmp/ccJ9wK5d.o(.text+0x1393): undefined reference to `makecol'
/tmp/ccJ9wK5d.o(.text+0x139c): undefined reference to `screen'
/tmp/ccJ9wK5d.o(.text+0x13d3): undefined reference to `makecol'
/tmp/ccJ9wK5d.o(.text+0x13e1): undefined reference to `font'
/tmp/ccJ9wK5d.o(.text+0x13e9): undefined reference to `textprintf'
/tmp/ccJ9wK5d.o(.text+0x1420): undefined reference to `makecol'
/tmp/ccJ9wK5d.o(.text+0x146e): undefined reference to `makecol'
/tmp/ccJ9wK5d.o(.text+0x147f): undefined reference to `font'
/tmp/ccJ9wK5d.o(.text+0x1487): undefined reference to `textprintf'
/tmp/ccJ9wK5d.o(.text+0x14b0): undefined reference to `makecol'
/tmp/ccJ9wK5d.o(.text+0x14be): undefined reference to `font'

... and so on.
also, i have : bash : allegro--config : command not found

and typping : gcc kpong.cpp -o kponglinux -lalleg
i have : /usr/bin/ld: cannot find -lalleg
collect2: ld returned 1 exit status

I've just install the rpm package..
???

Evert
Member #794
November 2000
avatar

Looks like allegro-config wasn't installed properly, since it doesn't seem to be in your path. Try to do a search for it - I have actually no idea where the rpm would put it.

However, I would strongly suggest you get the source .tar.gz instead of the binary rpm - there is no good reason not to if you're using linux. If you have unpacked the sources, go to the allegro directory and, as root, type

autoconf
./configure
make install

this should install a working version of allegro on your system, including allegro-config.

kjus
Member #2,433
June 2002

I've solved the problem : I with typing allegro--config instead of allegro-config !
what a stupid problem.
Thank you all for having answered me ;)

but, my programs are running slower on linux ! (compared to windows)

bozokadafi
Member #2,070
March 2002
avatar

i had somewhat of the same problem. my program didn't compile unless i did the following:

gcc shtuff.c `allegro-config --libs` `allegro-config --static` `allegro-config --cflags`

kjus
Member #2,433
June 2002

but now it is fixed..8-):D

Go to: