Linker error 2005, libcmtd.lib and msvcrtd.lib(MSVCR80D.dll)

I'm trying to port a project to VS2005 beta2 and I get lots of errors like this.

libcmtd.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR80D.dll)
libcmtd.lib(swprintf.obj) : error LNK2005: __swprintf already defined in msvcrtd.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR80D.dll)

Can anyone point me in the direction of fixing this
If its related to project properties can you specify which ones would cause it.

Thanks.
Jon


Answer this question

Linker error 2005, libcmtd.lib and msvcrtd.lib(MSVCR80D.dll)

  • Scott_Wolter

    I get this pestilence a lot. Look at the knowledge base article Q148652 for some clues.

     - Waldemar


  • JavaSci

    Today I also had this problem.
    It was solved by setting the "Configuration Properties" / "C/C++" / "Code Generation" / "Runtime Library" property to "Multi-threaded Debug (/MTd)".
    (The previous value of this property was "Multi-threaded Debug DLL (/MTd)".)
    Maybe this can help to others as well.

  • Wolverine10

    You have another library (old lib file) included that just supports only VC6, VC7.x.
    So the stuff you compiled is trying to use the CRT of VC8. The old stuff is using the libraries from the headers it was compiled with.

  • Vayse_Dev

    I also had this problem but mine was set to "Multi-threaded Debug(/MTd)" and changing it to "Multi-threaded Debug DLL (/MTD)" solved this

  • Linker error 2005, libcmtd.lib and msvcrtd.lib(MSVCR80D.dll)