[fpc-pascal] Problem linking external libs on Linux
Sven Barth
pascaldragon at googlemail.com
Sun May 12 19:48:50 CEST 2019
Anthony Walter <sysrpl at gmail.com> schrieb am So., 12. Mai 2019, 18:41:
> For example suppose I want to write some pascal code linking to an
> external functions like so:
>
> const
> libsdl2 = 'libSDL2-2.0.so.0';
>
> function SDL_Init(flags: Uint32): LongInt; cdecl; external libsdl2;
> procedure SDL_Quit; cdecl; external libsdl2;
>
> And when I try to compile the linking will likely failed because something
> is happening where the libsdl2 constant of 'libSDL2-2.0.so.0' is being
> converted to 'SDL2-2.0' at some point during the compilation or linking
> stage when working on Linux.
>
This is indeed how it is supposed to work. You are supposed to link against
the development library so that the linker can pick up the correct, real
library.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190512/2b3a4e74/attachment.html>
More information about the fpc-pascal
mailing list