Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-08

Linking pthread?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

David Butler

Hi

When I compile an application that uses libc under Linux I get:

"/usr/bin/ld: cannot find -lpthread"

From what I gather pthread is a standard library. How do I get the linker to find it?

Thanks.

David

Anton Tichawa
to David Butler

Hi,

David Butler wrote 20 lines
Hi When I compile an application that uses libc under Linux I get: "/usr/bin/ld: cannot find -lpthread" From what I gather pthread is a standard library. How do I get the linker to find it? Thanks. David _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Either the linker doesn't find it, or it's not there. On my linux box, there's a /lib/libpthread.so.0 -> /lib/libpthread-0.10.so, which is easily found by ld. You can check if a /lib/libpthread.so.? is installed on your system, or check ldconfig, e. g.

ldconfig -v | grep libpthread

Or you can add linker options to ld using fpc's "-k" option, e. g. "-k-v" for ld's -v option.

hth,

Anton.

David Butler
to Anton Tichawa

Hi Anton

Thanks for the pointers! libpthread was installed under /lib, but for some reason I had to copy libpthread.so.0 to libpthread.so to get ld to see it.

Regards
David

you wrote 42 lines
Hi, David Butler wrote: >Hi > >When I compile an application that uses libc under Linux I get: > >"/usr/bin/ld: cannot find -lpthread" > >From what I gather pthread is a standard library. How do I get the >linker to find it? > >Thanks. > >David > > >_______________________________________________ >fpc-pascal maillist - >http://lists.freepascal.org/mailman/listinfo/fpc-pascal > > > Either the linker doesn't find it, or it's not there. On my linux box, there's a /lib/libpthread.so.0 -> /lib/libpthread-0.10.so, which is easily found by ld. You can check if a /lib/libpthread.so.? is installed on your system, or check ldconfig, e. g. ldconfig -v | grep libpthread Or you can add linker options to ld using fpc's "-k" option, e. g. "-k-v" for ld's -v option. hth, Anton. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal