Why is pthread_static_lib still built with DLL CRT runtime?
Thanks for maintaining this project, it is handy for quick porting of pthread() nonsense to win32, however I've noticed (2 years ago when I first cloned this, and now as well) that win32 project files build the static lib using DLL runtime.
From my understanding, it's impossible to mix static and DLL runtimes, so if a portion of a project (for example this static pthread-win32) is built with DLL runtime, the REST of my project would need to be DLL'd as well.
I don't mind if DLL version of the pthread lib is built using whatever runtime, but i feel the "static" version at least should be built with static CRT.
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
in both debug and release and win32/x64 platforms.
Feel free to ignore this if there's a reason for the above to continue using DLL runtime.
Sideways related to my response at https://github.com/GerHobbelt/pthread-win32/issues/30#issuecomment-3481385835 : the reason is that I've used this pthreads library in a bunch of (business) applications, where several other components already were set up as DLL and/or were loading the VCRTL as DLL. It's a very hairy subject, but in my neighbourhood few people are doing fully static builds and adding a library to the mix which pulls in the static VCRTL while some other parts pull in the DLL version of same, things go horrible wrong -- the grave issue there being the wrongness often happens at odd times and less frequent than one may naively expect.
The binary files are provided, but I would advise everyone to use the C/C++ (+ MSVC build files, etc.) source files and "build from source"; similar thinking as one of the Linux distros does, where everything is built through the very same compiler toolchain all around (can't recall the name of that one right now 👎 )
Anyway, if I were to do it "right" with prebuilt binary files for the MSWin platform, there would need to be a plethora of choices:
- 32 vs. 64 bit builds.
- which VCRTL to use? (2a) Release Static, (2b) Debug Static, (2c) Release DLL, (2d) Debug DLL
and on 32-bit there was also the calling convention that can differ (__fastcall vs __cdecl).
This stuff starts to bite one in the a*s when doing (very) large application builds, hence my strong preference for "build everything from source" (**and synchronize all MSVC project files' settings and other build config across the board, while you do this "build from source" thing!) One example of such build tooling for MSVC is located in https://github.com/GerHobbelt/mupdf/tree/master/platform/win32/ (🤔 that repo is bloody huge, might be a useful thing to extract those tooling scripts from there and drop them in a small side repo...[^repo] 🤔 )
[^repo]: done now, rough & shoddy at https://github.com/GerHobbelt/MSVC-sln-vcxproj-synchronization-and-update-tooling
thanks for the reply. I do understand that it is a personal project that is used elsewhere and that’s why you keep the settings. However, I was not talking about the prebuilt binary files – I am building these from sources and that is why I left the comment. when opening one of the MSVC projects to build this, there are platform options like X86 , X64 and also a DLL or a static (library) build. Since I prefer not to have droppings of various DLLs inside my own application, I generally choose to statically link any external libraries that I use. And therefore, I also use static CRT so that I don’t have to deal with the problem of having to provide or pre-install VC run time.
from your description above, it sounds like you only use the DLL builds of this, and not static.
I use it both in DLL form and as static library builds -- the second set of MSVC project files resides outside this repo. The DLL-based usage is for older projects, while more recent work is all static builds.
Met vriendelijke groeten / Best regards,
Ger Hobbelt
web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: @.*** mobile: +31-6-11 120 978
On Mon, Nov 3, 2025 at 10:30 PM dongie @.***> wrote:
trollcop left a comment (GerHobbelt/pthread-win32#29) https://github.com/GerHobbelt/pthread-win32/issues/29#issuecomment-3482681424
thanks for the reply. I do understand that it is a personal project that is used elsewhere and that’s why you keep the settings. However, I was not talking about the prebuilt binary files – I am building these from sources and that is why I left the comment. when opening one of the MSVC projects to build this, there are platform options like X86 , X64 and also a DLL or a static (library) build. Since I prefer not to have droppings of various DLLs inside my own application, I generally choose to statically link any external libraries that I use. And therefore, I also use static CRT so that I don’t have to deal with the problem of having to provide or pre-install VC run time.
from your description above, it sounds like you only use the DLL builds of this, and not static.
— Reply to this email directly, view it on GitHub https://github.com/GerHobbelt/pthread-win32/issues/29#issuecomment-3482681424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADCIHRRAMNTF6O2IDSWGP3327CQ5AVCNFSM6AAAAACDAYT7R6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBSGY4DCNBSGQ . You are receiving this because you commented.Message ID: @.***>