[fpc-pascal] Static linking to C library on Linux

Ryan Joseph genericptr at gmail.com
Wed Nov 27 17:59:49 CET 2019

> On Nov 27, 2019, at 11:25 AM, Karoly Balogh (Charlie/SGR) <charlie at scenergy.dfmk.hu> wrote:
> Yes. By Default, FPC doesn't link against libc on Linux by default, only
> when some more advanced things, say, threading is used. To the contrary on
> Darwin (macOS), we always link against libc. There comes your difference
> from. You can just try to add {$LINKLIB C} to your code, and see if that
> helps.

Thanks that makes sense now. {$LINKLIB C} did help some of the errors but I'm still getting others. I'm aware of 'ldd' to show dependancies for dynamic libraries but how can I do this for static libraries on Linux? I'm getting defined references for math functions like pow, cos etc.. and some pthread ones also. There's probably more but how can I know?

	Ryan Joseph

More information about the fpc-pascal mailing list