rsk82 rsk82 -4 years ago 368
C++ Question

how to do static linking of libwinpthread-1.dll in mingw?

I use mingw from here:

http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev2.7z/download


And I've sucessfully managed to link statically
libstdc++-6.dll
and
libgcc_s_sjlj-1.dll
by using
-static-libgcc -static-libstdc++
parameters, but I cannot find a command for doing the same with
libwinpthread-1.dll
.

Answer Source

You should probably check command line options documentation for GCC.

These's no '-static-something' command, only standard libraries (libgcc and libstdc++) can be set to static linking with one command. For other libraries, you first switch to static linking with "-static" and then list the libraries to include with separate commands, ie "-lpthread".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download