Skip to content

clang,windows: why doesn't -fms-runtime-lib=dll implicitly pass -Wl,/NODEFAULTLIB:libcmt? #129881

@AlexRouSg

Description

@AlexRouSg

While trying to build a project that uses msvc built glfw which uses the dll runtime,
there are linker errors relating to conflicting runtimes. So the obvious thing to do would be to add /MD or the clang eq of -fms-runtime-lib=dll.

But apparently that doesn't set -Wl,/NODEFAULTLIB:libcmt which was not obvious was the problem as the warning only ever say

LINK : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library

So seems rather odd to have to say "use the dll runtime" and "don't use the static runtime" at the same time and wonder if there is a situation where someone would want that or is it something that could be implicitly set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions