none
error LNK2005 RRS feed

  • Question

  • Hi,

    Am getting the following errors while building a code:

    MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: putc already defined in LIBCMT.lib(fp
    utc.obj)
    MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: getc already defined in LIBCMT.lib(fg
    etc.obj)

    Now, the problem here is that these errors seem to be out of control, as all of these files are located in the MS Visual Studio directory.

    Plz help!
    Thursday, July 17, 2008 10:26 AM

Answers

  • Well, /MDd tells the linker to link with MSVCRTD.lib (which looks like what you're after), so perhaps rebuild all your .objs with that flag. That should eliminate the conflict.
    • Proposed as answer by MaxPower Friday, July 18, 2008 4:35 AM
    • Marked as answer by Yan-Fei Wei Monday, July 21, 2008 6:32 AM
    Thursday, July 17, 2008 11:33 PM

All replies

  • Looks like you messed up your project settings.

    Rebuild all your source code with /MDd ( Project settings -> C/C++ -> Code Generation )
    Thursday, July 17, 2008 11:42 AM
  • Hmm.. Am actually calling cl.exe from Cygwin. Can you advice me on the changes to be made? Add/MDd to the compiler options??
    Thursday, July 17, 2008 1:15 PM
  • Well, /MDd tells the linker to link with MSVCRTD.lib (which looks like what you're after), so perhaps rebuild all your .objs with that flag. That should eliminate the conflict.
    • Proposed as answer by MaxPower Friday, July 18, 2008 4:35 AM
    • Marked as answer by Yan-Fei Wei Monday, July 21, 2008 6:32 AM
    Thursday, July 17, 2008 11:33 PM