Hello everybody.

I'm new in this forum but I was coding games in C with Allegro for a long time, but since the TINS'06 competition where I wrote my entry in Pascal (Train) I decided to use only Pascal to create games.

So I decided to write a wrapper to use Allegro in Pascal, and I success in Windows but now I'm trying to port it to Linux and it doesn't work. It says it can't find the library files (-lalleg). All the files it needs are in /usr/local/lib and theirs names are liballeg_unsharable.a, liballeg.so.4.2 (this is a link to the real shared object) and alpas42.so (I wrote this one to allow Delphi-lovers to use it :toocool: ).

I'm using next code to link the files:

[pascal]
(**** from albase.pas ****)
INTERFACE

CONST
{ Access to the dynamic modules. }
{$IFDEF WIN32}
ALLEGRO_SHARED_LIBRARY_NAME = 'alleg42.dll';
ALL_PAS_SHARED_LIBRARY_NAME = 'alpas42.dll';
{$ENDIF}
{$IFDEF UNIX}
ALLEGRO_SHARED_LIBRARY_NAME = 'liballeg.so.4.2';
ALL_PAS_SHARED_LIBRARY_NAME = 'alpas42.so';
{$LINKLIB alleg_unsharable}
{$ENDIF}
[/pascal]

And the next to declare a procedure:

[pascal]
(**** from aldraw.pas ****)
INTERFACE

USES
albase, albitmap; { Needs some basic definitions. }

(* Clipping. *)
PROCEDURE al_set_clip_rect (bmp: AL_BITMAPptr; x1, y1, x2, y2: AL_INT); CDECL;
EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'set_clip_rect';
[/pascal]

And to build the examples (using GNU/makefile):

Code:
(**** from makefile.all ****)
# Executables.
$(EXMDIR)/%$(BINSUF): $(EXMDIR)/%.dpr
	fpc -Fu$&#40;LIBDIR&#41; FE$&#40;EXMDIR&#41; -FU$&#40;LIBDIR&#41; -WG+ $< -o$@
As I've said, it compiles, links and runs perfectly in Windows XP but it doesn't in Linux.

I'm using Free Pascal version 2.0.2 and GCC 4.0.3 in an actualized Kubuntu (no Lazarus) in a IBM ThinkCentre (P4, 512Mb blah blah...).

The Windows XP is in the same computer (other partition) with same compilers and also using MinGW32 5.1 and Msys 1.0.

Can anybody help me?

[comment] I know, there are a lot of great libraries for Free Pascal to make great games, but I like Allegro and I'll still using it. Please, do not try to convince me.