从VS2008转换到VS2010后,C ++ / CLI DLL项目停止链接

时间:2011-09-23 06:46:09

标签: c++ visual-studio-2010 c++-cli lnk2001

我转换了一个完美的Managed C ++ DLL项目,该项目使用从VS2008到VS2010的非托管C ++ LIB。事先我用VS2010分别重建了LIB(它们是我无权管理的另一个项目的一部分)。但是,转换后我的托管DLL项目停止链接,给我几个LNK2001错误消息(请参阅下面的示例)。关于在“string”和“iosfwd”标题中定义的“std”实体的所有错误。我缺少哪些编译器/链接器设置?

提前感谢您的帮助。


Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator!=<char,struct std::char_traits<char>,class td::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?9DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::npos" (__imp_?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const " (__imp_?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (__imp_??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z)

Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned __int64,unsigned __int64)const " (__imp_?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV12@_K0@Z)

etc...

1 个答案:

答案 0 :(得分:0)

终于找到了它(感谢Hans Passant的提示!)我有一些文件仍由VS2008构建,导致了这个问题。感谢所有打扰添加评论的人。