Swift on windows linking msvc dll errors

You should mark the library as a dynamic library target

Would you be able to elaborate on this a bit? I've got a project where I'm producing a dynamic library that ultimately gets consumed by C++ code, but as it's grown the number of LNK4217 errors has ballooned to a point I wanted to address it.

In the Package.swift we have multiple internal targets that all get combined into a single top-level product. I have type: .dynamic specified on the product, but I'm still getting these link warnings for nearly every symbol being used by the top-level target that is defined within a separate target.

Here is a very simple repro case: GitHub - kteynor/SwiftLinkerWarnings: Example to reproduce linker warnings when linking a dynamic library for windows