Будет ли статическая библиотека вызывать проблемы, если ее реализация использует STL? - PullRequest
0 голосов
/ 14 ноября 2011

Я создаю статическую библиотеку, в которой есть реализации, использующие 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
...