我正在嘗試將MySQL Connector/C++添加到Visual Studio 2010項目中。如何將MySQL連接器/ C++ 1.1添加到Visual Studio 2010項目中?
我按照步驟(here, mysql docs)將它添加到Visual Studio(我還在「其他包含目錄」中添加了Boost)。
它要求提供一個「sqlstring.h」文件(如何釋放可能會丟失文件?!),所以我從源文件(mysql source archives)中獲得了它。
然後,它要求libmyql.lib,我有MySQL服務器5.5 \ lib的lib目錄。
而現在,我對這個錯誤:
Error 127 error LNK1120: 31 unresolved externals C:\Users\Haks\Documents\Visual Studio 2010\Projects\ProductManager\Debug\ProductManager.exe ProductManager
Error 60 error LNK2001: unresolved external symbol
"__declspec(dllimport) bool __cdecl std::operator<<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 &,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]@Z)
C:\Users\Haks\Documents\Visual Studio 2010\Projects\ProductManager\ProductManager\mysqlcppconn-static.lib(mysql_ps_resultset.obj) ProductManager
所以,也許是因爲我的MySQL連接器/ C++ 1.1的二進制版本,也許它不是用VS 2010兼容...
但我沒有找到編譯源文件的好方法,我從不使用Boost或CMake,它似乎是需要的。
我發現沒有提及我的問題,所以如果有人得到了迴應或好方法,這對我和很多人都會非常有用。
謝謝
遵循與您相同的教程,有同樣的問題:)雖然這裏:http://forge.mysql.com/wiki/Connector_C%2B%2B,它說:[完成]準備支持Visual Studio 2010,所以可能下一個版本將支持2010年。 – 2011-03-01 15:18:22