Verifying CRT used in library (.lib)

前端 未结 2 1864
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 04:34

How do I check what runtime library a static library (.lib) in Windows has linked to?

I\'m compiling my project with /MDd and I presume a library I\'m linking to is usin

相关标签:
2条回答
  • 2021-02-20 05:04

    I was able to fix this doing the following

    > dumpbin /DIRECTIVES C:\..\ThirdParty\tidy\windows\lib\libtidy
    .lib
    Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file C:\..\ThirdParty\tidy\windows\lib\libtidy.lib
    
    File Type: LIBRARY
    
       Linker Directives
       -----------------
       /DEFAULTLIB:"LIBCMT"
       /DEFAULTLIB:"OLDNAMES"
    ...
    

    It's cleary linking to MT. I recompiled the lib using /MDd and it linked fine.

    0 讨论(0)
  • 2021-02-20 05:20

    Since MSVPRTD.LIB is the importlib of the dynamic link library of the crt, while you explicitely asked to link to the crt statically, something seems wrong with your build chain.

    You may want to check the project file visually for contradictions.

    0 讨论(0)
提交回复
热议问题