Thread overview
[Issue 19933] MSVC: Undefined std{in,out,err} with -betterC
Jan 10
kinke
Jan 10
kinke
Jan 10
kinke
Jan 10
kinke
Jan 11
Dennis
Feb 26
ryuukk_
Feb 26
ryuukk_
Feb 26
ryuukk_
January 10
https://issues.dlang.org/show_bug.cgi?id=19933

kinke <kinke@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke@gmx.net
            Summary|Win10 stdout link error?    |MSVC: Undefined
                   |                            |std{in,out,err} with
                   |                            |-betterC

--
January 10
https://issues.dlang.org/show_bug.cgi?id=19933

--- Comment #1 from kinke <kinke@gmx.net> ---
Quoting myself from https://github.com/ldc-developers/ldc/issues/3640#issuecomment-757464048:

The MSVC runtime doesn't feature these symbols; MS defines them as macros, whereas druntime defines and sets them at startup for convenience. [And druntime of course isn't linked with -betterC.]

--
January 10
https://issues.dlang.org/show_bug.cgi?id=19933

kinke <kinke@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All

--
January 10
https://issues.dlang.org/show_bug.cgi?id=19933

--- Comment #2 from kinke <kinke@gmx.net> ---
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.

--
January 11
https://issues.dlang.org/show_bug.cgi?id=19933

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |DragonDePlatino@gmail.com

--- Comment #3 from Dennis <dkorpel@live.nl> ---
*** Issue 20532 has been marked as a duplicate of this issue. ***

--
February 26
https://issues.dlang.org/show_bug.cgi?id=19933

ryuukk_ <ryuukk.dev@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ryuukk.dev@gmail.com

--- Comment #4 from ryuukk_ <ryuukk.dev@gmail.com> ---
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

--
February 26
https://issues.dlang.org/show_bug.cgi?id=19933

--- Comment #5 from ryuukk_ <ryuukk.dev@gmail.com> ---
I feel like the "Important" should be changed since it just crashes without any hints on how to solve the issue

--
February 26
https://issues.dlang.org/show_bug.cgi?id=19933

--- Comment #6 from ryuukk_ <ryuukk.dev@gmail.com> ---
Could https://github.com/dlang/druntime/blob/master/src/rt/msvc.d be moved to src/core?

So everyone could just call: init_msvc()

--