I am attempting to add MySQL Connector/C++ to my visual Studio 2010 project.
I adopted the steps (here, mysql docs) to combine it with Visual Studio (I additionally added Increase in the "Additional include Sites").
It requested a "sqlstring.h" file ( The way a release can miss personal files ?! ), and so i been with them in the source files (mysql source archives).
Then, It requested libmyql.lib, I'd the lib directory of MySQL Server 5.5lib.
And today, I am about this error:
Error 127 error LNK1120: 31 conflicting externals C:UsersHaksDocumentsVisual Studio 2010ProjectsProductManagerDebugProductManager.exe ProductManager
Error 60 error LNK2001: conflicting exterior 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 &)" (__imp_??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z)C:UsersHaksDocumentsVisual Studio 2010ProjectsProductManagerProductManagermysqlcppconn-static.lib(mysql_ps_resultset.obj) ProductManager
So, it can be because I acquired the binary discharge of MySQL Connector/C++ 1.1 and perhaps it isn't suitable for Versus 2010...
However I don't discover the great way to compile the origin files, and that i never use Boost or CMake and it is appear to become needed.
I discovered no mention of the my problem, therefore if someone got an answer or a great way, it will likely be very helpful for me personally and lots of people I believe.
I added mysqlcppconn_EXPORTS to my preprocessor symbols, and also the conflicting SqlString symbols disappeared.
However, I'm still getting
error LNK2028: unresolved token (0A000416) "extern "C" class sql::Driver * __cdecl get_driver_instance(void)" (?get_driver_instance@@$$J0YAPAVDriver@sql@@XZ)
I finally got MySQL Connector/C++ dealing with visual Studio 2010 by installing the origin and producing it with similar configurations as my project. Still it alerts about SqlString library:
j:\mysql-connector-c++-1.1.0\cppconn\sqlstring.h(36): warning C4251: 'sql::SQLString::realStr' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'sql::SQLString'
but, it appears to become comfortable with that.