7a1 Subj : Re: pthreads in a static library To : comp.programming.threads From : Yaytay Date : Thu Sep 01 2005 11:30 am wrote in message news:1125507212.847031.237460@f14g2000cwb.googlegroups.com... > Hello, and thanks for your replie. > I think I misformulated: >>>usually use pthreads in a dll, but now I want to use them in a static >>>library. > What I wated to say was: > I usally link with the pthreads-dll in my programs which make use of > pthreads. > Now I've created (just compiled as a new project: "static lib") a > static version of pthreads. > I wanted to use this static version to link my program with. > ( so: now I add: #pragma comment(lib,"mystaticversion.lib") in stead of > #pragma comment(lib,"thedynamicversion_which_was_pre-builded.lib") ) > When I do that however, I have the errors I described. > I think you misunderstood my question, did you? (I know it's my fault, > sorry for that). > > Sorry for my poor english, but as you see, I'm not english... > I did misunderstand at first, then realised that that might be what you are trying to do and covered that possibility in my last paragraph. Basically pthreads is not designed to be used that way, so you'll have to make a number of changes to the source (and I don't know what). The primary issue is that the source declares functions as either dllimport or dllexport - neither of which is correct for a static library. Minimally you will need to identify those functions that are declared as dllexport and change them - this might be as simple as changing the header files that use PTW32_BUILD (probably requiring you to set up another macro to indicate what you are trying to do and override the PTW32_BUILD control) - but then again it might not. Sorry I can't be more help, your answer is still not relevant to threading, but it does require a knowledge of the internals of pthreads. J.T. . 0