Subj : Re: pthreads in a static library To : comp.programming.threads From : Yaytay Date : Wed Aug 31 2005 06:19 pm wrote in message news:1125488715.639203.48630@g49g2000cwa.googlegroups.com... > Now when I'm trying to use them in a program I have for every function > a link error (I did included the header files, and it doesn't has > anything to do with the calling conventions...). Jim, This isn't a threading problem, it's just a question of knowing what the static lib is doing. You don't make it clear whether you are trying to build a lib that contains pthread or one that intends to make use of pthread from a DLL. It appears that, whichever you want, you've asked for the second of these. When you build a static lib it just contains all of the object files that you've just compiled, unless you take extra steps it doesn't contain much else (a bit of housekeeping). What it most explictly doesn't contain is anything that is referenced by your object files. So your object files still reference pthread functions that come from the pthread DLL. You have two choices, you can either reference the import lib for pthreads when you link the final program or you can explicitly add the import lib for pthreads to the list of things that lib will include. If, on the other hand, you are trying to produce a static lib that just contains pthreads then I think you have more work ahead of you as pthreads doesn't appear to be designed to work that way. A number of the pthread headers contain preprocessor instructions that make all of the pthread functions either DLL import (for using pthreads in a DLL) or DLL export (for making them available from a DLL) - neither of these is correct for making them available from a static lib. J.T. .