[Lazarus] old problem on FreeBSD: ld cannot find -lc_r

Marco van de Voort marcov at stack.nl
Wed Jul 24 12:18:31 CEST 2013

On Fri, Jul 19, 2013 at 04:34:34AM +0200, Marc Santhoff wrote:
> after unpacking the brand new lazarus 1.0.10 and compiling it anything
> works fine. The next step was to install the lazreport package into the
> IDE. Compilation worked up to the linking process:
>   /usr/bin/ld: cannot find -lc_r
>   lazarus.pp(135) Error: Error while linking
>   lazarus.pp(135) Fatal: There were 1 errors compiling module, stopping

Sounds like a -Xf parameter problem. Without this parameter, pthread is
chosen, with libpthread.

So probably you have some stale -Xf in the project, probably in a *really*
old project.

Really old versions worked the other way around (c_r default, + -Xf ->

> This is pretty old and I had this once while FreeBSD was swapping one
> threading library for another. Nowadays "-lc_r" is unsupported AFAIK and
> one should use "-lpthread" instead.

A year ago, there were still people with 4.x servers. But the rarety is why
the default was changed. Just kill all -Xf parameters.

More information about the Lazarus mailing list