https://issues.dlang.org/show_bug.cgi?id=18999
Issue ID: 18999 Summary: MSCRT selection specifies _ITERATOR_DEBUG_LEVEL and produces a `version` Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: turkey...@gmail.com For Win32/Win64, `_ITERATOR_DEBUG_LEVEL` needs to be embedded in the binary with the value 0 or 2 matching the version of mscrt that was selected. 0 for release runtime, 2 for debug runtime. If no crt is selected, then it should be omitted. This will allow D objects to link against C++ objects that were built for the respective runtime. We also need a version() for the mscrt selected at compile time, so that we can guide struct contents against the runtime selected (STL structs have different content based on _ITERATOR_DEBUG_LEVEL) A resolution to this problem might be if only a version were specified, and also a pragma that allowed embedding _ITERATOR_DEBUG_LEVEL only when a module imports a `core.stdcpp` module. That way only objects that interact with STL would entail the linkage problems associated with microsoft's runtime. --