Just noticed that the OP hasn't used -betterC, but a C main, thus skipping the druntime initialization (incl. setting std{in,out,err}). With LDC v1.25, there's no linker error anymore, but the expected segfault as with DMD.
Comment #3 by dkorpel — 2021-01-11T13:59:42Z
*** Issue 20532 has been marked as a duplicate of this issue. ***
Comment #4 by ryuukk.dev — 2021-02-26T22:41:04Z
I just got hit by this, using -betterC
There are no errors, it just crash
The solution is to init windows runtime, but how to do that?
Shouldn't the solution be simpler? the experience as a result is very poor
Comment #5 by ryuukk.dev — 2021-02-26T22:45:22Z
I feel like the "Important" should be changed since it just crashes without any hints on how to solve the issue
@rainers created dlang/druntime pull request #3740 "fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC" fixing this issue:
- fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC
moved C runtime check into template function
https://github.com/dlang/druntime/pull/3740
Comment #8 by dlang-bot — 2022-02-14T09:34:37Z
dlang/druntime pull request #3740 "fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC" was merged into master:
- e7e6800babed4ff51b6c3b57dfa7e54cb76247f7 by Rainer Schuetze:
fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC
made stdin/out/err template function return value
https://github.com/dlang/druntime/pull/3740