1
我轉換了一個完美的託管C++ DLL項目,該項目使用從VS2008到VS2010的非託管C++ LIB。事先我分別用VS2010重建了LIB(它們是我沒有權限的另一個項目的一部分)。但是,在轉換後,我的託管DLL項目停止鏈接,並且幾乎沒有發現LNK2001錯誤消息(請參閱下面的示例)。有關「字符串」和「iosfwd」頭文件中定義的「std」實體的所有錯誤。我錯過了哪些編譯器/鏈接器設置?從VS2008轉換到VS2010後,C++/CLI DLL項目停止鏈接
在此先感謝您的幫助。
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 *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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 &)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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" ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@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)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@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 " ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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 " ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected])
etc...
通過「Managed C++」,你的意思是「託管擴展C++」? 2001年被宣佈死亡並被C++/CLI取代的東西? –
嗯,它是C++/CLI。 :) – Puzzled
您確定已將您使用VS 2010編譯的Auxiliary.lib替換爲Auxiliary.lib嗎? – wilx