April 28, 2022
https://issues.dlang.org/show_bug.cgi?id=23072

          Issue ID: 23072
           Summary: Creating a shared library using VS 2019 cannot find
                    `open`
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: alphaglosined@gmail.com

Simple scenario:

```d
module testshared.d
import std.stdio;

void f() {
  writeln("Hello, World!");
}
```

$ dmd -shared testshared.d

This produces a lot of linker errors due to missing libcmt.lib.

With that added only one linker error remains:

phobos64.lib(gzlib.obj) : error LNK2019: unresolved external symbol open referenced in function gz_open

This works with ldc 1.29.0-beta1, but not dmd 2.099.0.

I managed to copy some arguments from ldc that got it to link.

$ dmd -shared testshared.d -L/DEFAULTLIB:msvcrt -L/DEFAULTLIB:vcruntime oldnames.lib

That command worked.

--