我正在一個大項目從Visual Studio 2008(平臺工具集V90)到Visual Studio 2010(平臺工具集V100)移動從Visual Studio 2008中使用靜態庫與Visual Studio 2010
該項目依靠庫使用v90工具集進行編譯。這個庫在很大程度上是用C語言編寫的,在一些地方使用了std:string。不幸的是這種用法阻止我與庫鏈接編譯由於工具箱的變化
我從錯誤中刪除的庫名:
: error LNK2001: unresolved external symbol "__declspec(dllimport) 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 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]@@Z)
: error LNK2001: unresolved external symbol "__declspec(dllimport) 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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
: error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" ([email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
: error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int 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]@2IB)
: error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
: error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(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]@@Z)
: error LNK2001: unresolved external symbol "__declspec(dllimport) 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 *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
: error LNK2001: unresolved external symbol "__declspec(dllimport) 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)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
有什麼我能做的事編譯下這個庫平臺工具集v100?該庫是專有的,所以我無法獲取源代碼並重新編譯自己。
聯繫供應商,看看他們是否有用VC++編譯的庫的版本10 –
我認爲你唯一能做到的方法就是在VC2008中製作一個包含靜態庫的DLL,並提供一個C風格的界面,從你需要的任何功能。然後,您需要爲2008和2010分發運行時。 – Pete
如果運行時靜態鏈接到dll,則@Pete 2008運行時可能不是必需的。 –