>A customer had a small program using pthreads that crashed pretty much at
startup. After verifying the crash on my system, I noticed that the customer
>had not linked the program with libpthread. Adding -lpthread to the linking
> command fixed the problem.
>
>If a program does not link a needed library, shouldn't it fail at link time?
>As it is, the program links and loads, but crashes mysteriously. Why is this
>a good idea? Why are there entry points in /lib/libc.so.1 for pthread 
>functions,
> but not the pthread functionality?

Your customer is not using Solaris 10 or OpenSolaris; on those systems, 
there's no longer a specific -lthread or -lpthread.  They all live in libc.

For older releases, he must make sure that he handles all error returns 
from pthread* and such.

Casper

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to