Actually a static pthreads is actually very hard. You need to manually initialize pthreads and it gets a hell of a lot more complicated from then on.


On Wed, Aug 14, 2013 at 8:20 PM, John Brown <johnbrown105@hotmail.com> wrote:
On Wed, 14 Aug 2013 19:57:25 +0300, Radu Rendec wrote:
>
> Hi,
>
> Is there any easy way to statically link against pthread? Using
> -lpthread always creates a dependency on pthreadGC2.dll, even when using
> -static.
>

I believe that MinGW distributes only the DLL and its associated import
library. If you want the static library, you will have to compile it
yourself.


> I also tried using libpthreadGC2.dll.a along with the other objects to
> be linked when producing the executable (instead of using -lpthread),
> but with no effect. I believe this is because libpthreadGC2.dll.a is
> just an "import library" and I'm statically linking the import wrappers,
> not the actual pthread functions.

That is correct. The naming convention is that lib*.a is a static
library and lib*.dll.a is an import library.

Regards,
John Brown.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@lists.sourceforge.net?subject=unsubscribe