如果静态库的实现使用STL会导致问题吗?

时间:2011-11-14 06:48:10

标签: c++ visual-studio-2008 stl static-libraries

我正在创建一个静态库,其中包含使用string,fstream和iostream的实现,我收到以下错误。 STL会导致碰撞吗?

Error   1   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@@QBEPBDXZ) already defined in main.obj    msvcprtd.lib

Error   2   error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in main.obj  msvcprtd.lib

Error   3   error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)  MSVCRTD.lib

Error   4   error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)    MSVCRTD.lib

Warning 5   warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library   Serialization Sandbox

Error   6   fatal error LNK1169: one or more multiply defined symbols found C:\Users\Blake\Desktop\Sandbox\Serialization\Debug\Serialization Sandbox.exe

0 个答案:

没有答案