Static linking under win32

Ross Johnson rpj@callisto.canberra.edu.au
Mon Dec 6 06:22:00 GMT 2004


Gili wrote:

>Hi,
>
>	I'm sure this is a commonly asked question: how do I build
>pthreads-win32 under VC++ (7.1 in my case)? I am surprised you don't
>ship a project file with the source-code or discuss this in the FAQ :)
>  
>
Yes, it should be in the FAQ.

Pthreads-win32 relies on dynamic linking to provide a seemless interface 
to it's POSIX functionality - using dllMain to do some per process and 
per thread initialisation and cleanup. Static linking requires your 
application to call some non-portable routines (see README.NONPORTABLE: 
pthread_win32_process_attach_np etc). That's one reason why static 
linking is not really 'officially' encouraged.

However, there's a VS Workspace file provided that will build the DLL. 
It was contributed by a user and I use it for debugging sometimes. 
Perhaps you can modify that one and send me the result.

Nor do the makefiles that I use to build and test include targets for 
static linking.

Regards.
Ross



More information about the Pthreads-win32 mailing list