This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: Does static library works ?
The mechanisms of the pthreads library where originally written to
take advantage of the Windows DllMain for implicitly
However, some didn't want to use the DLL... therefore the implicit
creation/destruction of resources (as well as the implicit invocation
of TSD optional destructors) must be carried out explicitly by the
user in the event that they want to use a static library. These
methods are _np (non portable).
I would have expected that the test cases would have been
conditionally compiled to accommodate the testing of the static
version of the library...
John E. Bossom
Quoting Arnaud RICHARD <email@example.com>:
I have tried with MinGW.
It doesn't pass either. (but pass in dynamic of course).
So it is not due to something specific to MSVC.
Looking more closely... I found out than some functions must be called
only when linking statically:
There is some explanations in the file README.NONPORTABLE
It's the first time ever I see code specific to static linking...
maybe because I'm a newbie on MS platform.
I post this solution for future
Arnaud RICHARD <firstname.lastname@example.org> wrote:
I tried to build my program statically with pthreads.lib.
It crash at run-time in "pthread_cond_init()".
So I tried to run the tests.
First surprise: the test suite only run with DLL, and not with .LIB.
I have enhanced the makefile to run the tests in static.
Second surprise: most tests fails (but not all).
Has anyone tried to do it ?
I attached the modified makefile, the target to run is "make clean
Any feedback welcome,
PS: I use MSVC2008, and compile "VC-static"