Menu

Link problems in MSVC++ 6

Help
coombs
2008-05-30
2013-04-24
  • coombs

    coombs - 2008-05-30

    I'm trying to use this class in a Dialog based MFC project.  I've compiled the xmlrpc project and added the xmlrpc.lib file to my included libs, but I get a ton of link errors.

    --------------------Configuration: XMLRPCTest - Win32 Debug--------------------
    Linking...
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin
    g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libcpmtd.lib(string.obj)
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q
    BEPBDXZ) already defined in libcpmtd.lib(string.obj)
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class basic_
    string<char,struct std::char_traits<char>,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in libcpmtd.lib(string.obj)
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE
    IXZ) already defined in libcpmtd.lib(string.obj)
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::out_of_range::out_of_range(class out_of_range::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0out_of_range@std@@QAE@ABV?$basic_string@DU
    ?$char_traits@D@std@@V?$allocator@D@2@@1@@Z) already defined in libcpmtd.lib(string.obj)
    msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_string<char,s
    truct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcp
    mtd.lib(string.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _atoi already defined in libcmtd.lib(atox.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in libcmtd.lib(strncmp.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __strnicmp already defined in libcmtd.lib(strnicmp.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _floor already defined in libcmtd.lib(floor.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __vsnprintf already defined in libcmtd.lib(vsnprint.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strtol already defined in libcmtd.lib(strtol.obj)
    MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __snprintf already defined in libcmtd.lib(snprintf.obj)
    LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
    Debug/XMLRPCTest.exe : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.

    XMLRPCTest.exe - 15 error(s), 1 warning(s)

    It seems some things are getting defined multiple times.  Any ideas how to fix this?

    Thanks.

     
    • Chris Morley

      Chris Morley - 2008-05-30

      Use consistent settings in the projects for the runtimes (eg, set all to use debug multithreaded dll). Also ensure you use consistent MFC libs (http://support.microsoft.com/kb/148652).

       
    • coombs

      coombs - 2008-05-30

      Nice!!!!  I just had to change the project settings in the xmlrpc project to include the "Use MFC in a Static Library".  Now it compiles fine.  Now I just have to get it to interact with Flickr.  Wish me luck.

       
      • Chris Morley

        Chris Morley - 2008-05-30

        Let me know how it goes. There are a quite a few bug fixes in cvs right now that should probably be officially released, but you might have trouble using vc++ 6 - I have been using vc++ 2005 and have not been keeping the vc 6 dsp files up to date.

        Chris

         

Log in to post a comment.