"Hybrid CRT" linking and DLLs #6166
-
|
Microsoft has recently pushed the "hybrid CRT" linking method (https://aka.ms/hybridcrt) in its own App SDK recently. As I understand it, it basically means dynamically linking the UCRT while statically linking the STL and some other bits. Sorry if this is the wrong place to ask, I thought it might be more likely to get a reply from an expert who knows the answer here. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
That's risking catastrophe. The moment you pass a single STL object across your DLL boundaries, you're risking severe doom (especially with anything touching our global data like locales, certain atomic locks). I wouldn't do this with anything other than a monolithic EXE.
I'm not exactly delighted to see this complexity spreading throughout the ecosystem. (This is the first I've heard about it. We have an ancient deprecated macro, which I will not name here, that accomplished something very similar to this, that I've wanted to remove for over a decade.) |
Beta Was this translation helpful? Give feedback.
-
|
That's a shame, thanks for the reply. My problem is I'm trying to make a library that has an extern "C" API but uses a lot of new C++ internally, and people keep trying to dynamically load it into things like their own python.exe that use an old bundled vc runtime, ignoring either one I bundle or the system one, which then blows up. On the other hand I was trying to avoid making one monolithic binary because it makes LGPL compliance with my dependencies painful. This hybrid linking seemed to thread the needle between the two, preventing the user from using the wrong runtime while allowing me to distribute multiple DLLs. I guess the only reason it's not caused severe doom yet is that I'm not passing much more than |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, we don't support anything like that. |
Beta Was this translation helpful? Give feedback.
That's risking catastrophe. The moment you pass a single STL object across your DLL boundaries, you're risking severe doom (especially with anything touching our global data like locales, certain atomic locks). I wouldn't do this with anything other than a monolithic EXE.
I'm not exactly delighted to see this complexity spreading throughout the ecosystem. (This is the first I've heard about it. We have…