[quote="Almindor"]Make sure it's the right name you use. Also -lname must match for ld. Basicly check out what the filename of allegro so file is, if the sym]
The soname is "liballeg.so.4.2", which is the same I'm using in the "EXTERNAL" declaration. The real name of the library is "liballeg-4.2.1.so" so I should pass to the linker "-lalleg-4.2.1", don't I?
The files and the symlink are right:
Code:
% ls -l /usr/local/lib
total xxx
drwxr-xr-x 3 root root 4096 2006-12-15 21:01 allegro
-rwxr-xr-x 1 root root 165105 2006-12-15 22:01 alpas42.so
drwxr-xr-x 4 root root 4096 2005-12-07 10:08 fpc
-rwxr-xr-x 1 root root 898213 2006-12-15 21:01 liballeg-4.2.1.so
lrwxrwxrwx 1 root root 17 2006-12-15 21:01 liballeg.so.4.2 -> liballeg-4.2.1.so
-rw-r--r-- 1 root root 176444 2006-12-15 21:01 liballeg_unsharable.a
[quote="Almindor"]You can test alot with gcc to see what that uses. (btw you have to explicitly tell this to gcc, so if it works with -lallegro in gcc and not via fp {don't forget, both use ld as ]
In gcc uses an script that returns all options it needs:
Code:
% allegro-config --libs
-L/usr/local/lib -L/usr/X11R6/lib -Wl,--export-dynamic -lalleg-4.2.1 -lalleg_unsharable
[quote="Legolas"]Try to omit ]
Done. I used:
Code:
fpc -s -Fulib -FEexamples -FUlib -WG+ examples/extruec.dpr -oexamples/extruec.bin
The paths are correct but the libnames aren't correct. This is the actual content of link.res:
Code:
INPUT(
-lalleg
-lalpas42
-lalleg_unsharable
)
And this is what (I think) it shoul be:
Code:
INPUT(
-lalleg-4.2.1
-lalpas42
-lalleg_unsharable
)
[edit] Wait, I've find that there are a "SEARCH_DIR(/usr/lib/)" but there are not a "SEARCH_DIR(/usr/local/lib/)". Is this the problem? How can I fix it?
[edit] Surelly I'm the most stupid man here: technomage said how to fix it. Anyway it still not linking...
Code:
% make examples
fpc -Fulib -FEexamples -FUlib -Fl/usr/local/lib -WG+ examples/exdata.dpr -oexamples/exdata.bin
Free Pascal Compiler version 2.0.2 [2005/12/07] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for i386
Compiling examples/exdata.dpr
Linking examples/exdata.bin
/usr/bin/ld: no se puede encontrar -lalleg
exdata.dpr(106,1) Error: Error while linking
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
make: *** [examples/exdata.bin] Error 1
The link.res file is the same but added a SEARCH_DIR(/usr/local/lib/)" line.
Bookmarks