-mthreads

Erik van Pienbroek erik at vanpienbroek.nl
Thu Sep 15 20:43:00 UTC 2011


Simson Garfinkel schreef op do 15-09-2011 om 17:06 [+0100]:
> I am having a problem creating multi-threaded executables that are statically linked. Even though I am using the -static flag, the resulting executable has a dependency for pthreadGC2.dll. Unfortunately, for my application we do not wish to have ANY DLL dependencies.
> 
> Here is my linkage line:
> 
> x86_64-w64-mingw32-g++  -D_FORTIFY_SOURCE=2 -Wall -g -Wno-format  --static -mthreads   -o tigerdeep.exe md5.o sha1.o sha256.o whirlpool.o tiger.o main.o hashlist.o multihash.o display.o hash.o dig.o helpers.o xml.o files.o threadpool.o  -lws2_32 -lgdi32 -liberty -lpthread
> 
> The problem seems to be that all of the libraries have been built for dynamic linking.

Hi,

This is expected behaviour. The mingw{32,64}-pthreads package only
contain shared libraries at the moment so even if you specify the
'-static' compiler flag it will still create a dependency on the
pthreads dll.

You might want to look into the possibility of adding support for a
static pthreads library to the mingw-pthreads package and creating a
mingw{32,64}-pthreads-static subpackages.

Kind regards,

Erik van Pienbroek




More information about the mingw mailing list