How can I resolve this link error in Visual Studio (LNK2005)?

后端 未结 4 1205
我寻月下人不归
我寻月下人不归 2021-01-05 20:50

I keep having linker errors of the following form:

libcmtd.dll msvmrtd.dll some element(ex: _mkdir ) already defined...

4条回答
  •  悲&欢浪女
    2021-01-05 21:06

    The MSDN article on LNK4098 has a very useful table: it tells you which libraries to manually add to the "Ignore specific library" list, depending on which CRT you're using. You need to pick a CRT (Multithreaded or not; static or DLL; debug or release), and then add the ignore libraries based on your choice.

    The underlying cause is described in more detail in KB154753 ... libraries that a program will link with when built by using Visual C++

    My interpretation of this is that in certain situations the algorithm that automatically picks which CRT libraries to link your code with will pick several conflicting libraries.

提交回复
热议问题