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

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 19 08:05:13 CEST 2013

On Fri, 19 Jul 2013 04:34:34 +0200
Marc Santhoff <M.Santhoff at web.de> wrote:

> Hi,
> 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
> 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.

The default widgetset on FreeBSD is gtk2. The gtk2int.pp has {$linklib

> I have searched lazarus' Makefiles, my personal configuration in
> ".lazarus" and checked there is no mapping file for the linker messing
> things up. The fpc.cfg seems to be fine (an unaltered by me) too.
> Where does this come from?

I guess from one of the fpc units.

> Where should I search to find the error?

You can grep for linklib directives in the sources.
And you can use the ppudump tool on all .ppu files and grep for c_r.

> TIA,
> Marc
> FreeBSD 9.1-STABLE amd64
> fpc 2.6.0
> lazarus 1.0.10


More information about the Lazarus mailing list