Help! Linux & Allegro
jownas

Hello!

How do I set up an allegro project in Linux?? I've installed Allegro like this:
sh fix.sh unix
./configure
make
make install

I'm using suse 8.1 and kdevelop. What project shall I choose to make in kdevelop?? I've tested some of them but every type gives the same error... The program I've tried to build looked like this:

#include <allegro.h>

int main()
{
allegro_init();
return 0;
}
END_OF_MAIN();

In the project opions I link the following file:
/usr/local/lib/liballeg-4.0.2.so

When I try to build the project I get the following errors:
/bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wbad-function-cast -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -O0 -g3 -Wall -fno-exceptions -fno-check-new -o ggg main.o /usr/local/lib/liballeg-4.0.2.so
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_zbuf_atex_trans8'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_scanline_atex_mask_lit32'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_zbuf_ptex_mask_trans15'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_linear_blit8_end'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_scanline_grgb8'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_linear_putpixel24'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_linear_blit24_end'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_scanline_atex_lit24x'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_poly_scanline_atex_mask_lit15'
/usr/local/lib/liballeg-4.0.2.so: undefined reference to `_linear_draw_lit_rle_sprite15'
+++ Many more +++

I'm new to linux and GCC.... It's not neccesary to get it to work in kdevelop... If anyone knows how to set up an allegro project from the command line i would be pleased....

Thanks!

Matthew Leverton

Read the build docs, specifically note how you are to use:

`allegro-config --libs`

PyroBoy

Well there are lots of other ide's for linux and if you like the console i think theres a port of rhide :).

i just use glimmer(gnome app) or kate(kde app) and a self roled makefile. i dont like all the extra junk you get with kdevelop. anjuta is also very good(better then kdevelop in my veiw).

Thomas Fjellstrom
Quote:

anjuta is also very good

Yup. ([aol]ME TOO[/aol]) I really like Anjuta, mostly for the editor it uses. So now that I dont have access to a linux machine, I've started writing a simple multifile editor using the same edit control (Scintilla).

PyroBoy

Cool, could you relesse it if it ever gets any where... or even if its usable. Ill do some testing for you. ;D

jownas

humm.... What I meant with setting up allegro from the command line was: How do I compile my project from a linux comman prompt, wich commands shall I give gcc??? Do I need to link any more librarys than liballeg-4.0.2.so ???

When I installe allegro I got a message that said that I had to configure /etc/ld.so.conf, and add a directory to /usr/local/lib - can that have anything to o with my problem???

Example:
gcc MyAllegroApp.cpp ?options?

- The Newbie

miran

click here

I'm not sure but I think they evetually answered the question... Anyway you must open the ld.so.conf file add the path where the Allegro library got installed and run ldconfig or something like that. You have to do all of that logged on as root.

jownas

thanks! If think I've got the allegro library to work now... But now other problems occured instead =)

I compiled my file in the following way:
g++ -o hata hata.cpp -lalleg

hata.cpp lookes like this:
#include <allegro.h>

int main()
{
allegro_init();
return(0);
}
END_OF_MAIN();

Then the liballeg.a complaine about undefined references to: xwin_sysdrv_unit, XInitthreads plus many more X********.

I tried to pass the option -lX11 to g++ but then I got a message that says:
/usr/i386-linux/bin/ld:cannot find X11

miran

You have to link with `allegro-config --libs` and NOT -lalleg, like this:

g++ -o hata hata.cpp `allegro-config --libs`

And read the first reply by Matthew again!

jownas

Thanks Miran! It worked!

Thread #213841. Printed from Allegro.cc