[Issue 19760] Windows 10 -m64 completely broken, can't compile/run hello world

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 28 13:07:00 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19760

--- Comment #16 from kinke at gmx.net ---
(In reply to anonymous4 from comment #15)
> (In reply to kinke from comment #11)
> > Musl on Windows? I just mentioned alternative runtimes for completeness;
> > even if somebody wanted to go through all that trouble, incl. adapting
> > druntime, there'd be still one big drawback: if you want to mix D and C(++)
> > code and use the same heap etc., you have to make sure both parts use the
> > same runtime.
> 
> Technically there's Universal CRT.
> If the problem is only with math functions, I suppose those can be
> separately taken from musl, should be standalone.

Please just trust my and Rainer's judgement on this, we have been deeply
involved with all this.
Universal CRT is one part of the newer MS runtimes since 2015 (and so used when
linking against recent MS msvcrt.lib or libcmt.lib). It doesn't solve anything
for us (as it isn't preinstalled on older Windows; not sure if it's
preinstalled on Win10), except making the runtime installation somewhat harder
(requires a reboot IIRC).
The problem isn't only with math functions (e.g., no hex float parsing, buggy
snprintf in older MS runtimes...). And in contrast to all/most? other x86(_64)
runtimes, Microsoft chose 64-bit double precision for `long double`, so printf
etc. from other runtimes won't work out of the box. And for LDC, we use the
Visual C++ EH personality function (which for example is not part of the
Universal CRT).

> If you use C/C++ code, you either compiled it and then have visual studio,
> or not and you again have the problem of the same runtime.

I'm not sure I get what you mean. But the MS runtime is not just used by the MS
compiler, but also by MinGW-gcc and the Intel compiler, and those are, I guess,
at least a thousand times more popular than all the other C(++) compilers on
Windows combined.
If you meant that you need a runtime *version* compatible with the C(++) code,
then yes, you either need an older Visual Studio compatible with that version,
or you might get away with selecting one of the many runtime versions LDC ships
with (all dynamic ones from VS 2002-2015) via `-mscrtlib`.

--


More information about the Digitalmars-d-bugs mailing list