MySQL C ++连接器未解决的依赖关系(VS 2015) [英] MySQL C++ Connector Unresolved Dependencies (VS 2015)

查看:127
本文介绍了MySQL C ++连接器未解决的依赖关系(VS 2015)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows/Visual Studio 2015上编译MySQL Connector C ++. 我根据

I'm trying to compile MySQL Connector C++ on Windows / Visual Studio 2015. I generated the project file using CMake according to the official instructions, which worked fine. Now when I try to compile the solution,I get the following linker errors:

5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_server_init@12 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::library_init(int,char * *,char * *)" (?library_init@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHHPAPAD0@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_server_end@0 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::library_end(void)" (?library_end@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXXZ)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_thread_init@0 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::thread_init(void)" (?thread_init@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXXZ)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_thread_end@0 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::thread_end(void)" (?thread_end@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXXZ)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_num_rows@4 referenced in function "public: virtual unsigned __int64 __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::num_rows(struct st_mysql_res *)" (?num_rows@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAE_KPAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_num_fields@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::num_fields(struct st_mysql_res *)" (?num_fields@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_fetch_field_direct@8 referenced in function "public: virtual struct st_mysql_field * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::fetch_field_direct(struct st_mysql_res *,unsigned int)" (?fetch_field_direct@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_field@@PAUst_mysql_res@@I@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_field_count@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::field_count(struct st_mysql *)" (?field_count@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_affected_rows@4 referenced in function "public: virtual unsigned __int64 __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::affected_rows(struct st_mysql *)" (?affected_rows@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAE_KPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_errno@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::mysql_errno(struct st_mysql *)" (?mysql_errno@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::error(struct st_mysql *)" (?error@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_sqlstate@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::sqlstate(struct st_mysql *)" (?sqlstate@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_warning_count@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::warning_count(struct st_mysql *)" (?warning_count@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_info@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::info(struct st_mysql *)" (?info@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "public: virtual struct st_mysql * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::init(struct st_mysql *)" (?init@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql@@PAU5@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_ssl_set@24 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::ssl_set(struct st_mysql *,char const *,char const *,char const *,char const *,char const *)" (?ssl_set@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql@@PBD1111@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "public: virtual struct st_mysql * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::real_connect(struct st_mysql *,char const *,char const *,char const *,char const *,unsigned int,char const *,unsigned long)" (?real_connect@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql@@PAU5@PBD111I1K@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_query@8 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::query(struct st_mysql *,char const *)" (?query@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@PBD@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_real_query@12 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::real_query(struct st_mysql *,char const *,unsigned long)" (?real_query@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@PBDK@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_store_result@4 referenced in function "public: virtual struct st_mysql_res * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::store_result(struct st_mysql *)" (?store_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_res@@PAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_use_result@4 referenced in function "public: virtual struct st_mysql_res * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::use_result(struct st_mysql *)" (?use_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_res@@PAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_get_character_set_info@8 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::get_character_set_info(struct st_mysql *,void *)" (?get_character_set_info@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPAUst_mysql@@PAX@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_ping@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::ping(struct st_mysql *)" (?ping@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_get_server_info@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::get_server_info(struct st_mysql *)" (?get_server_info@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_get_client_version@0 referenced in function "public: virtual unsigned long __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::get_client_version(void)" (?get_client_version@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEKXZ)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_get_server_version@4 referenced in function "public: virtual unsigned long __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::get_server_version(struct st_mysql *)" (?get_server_version@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEKPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_options@12 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::options(struct st_mysql *,enum mysql_option,void const *)" (?options@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@W4mysql_option@@PBX@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_options4@16 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::options(struct st_mysql *,enum mysql_option,void const *,void const *)" (?options@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@W4mysql_option@@PBX2@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_get_option@12 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::get_option(struct st_mysql *,enum mysql_option,void const *)" (?get_option@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@W4mysql_option@@PBX@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_free_result@4 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::free_result(struct st_mysql_res *)" (?free_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_data_seek@12 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::data_seek(struct st_mysql_res *,unsigned __int64)" (?data_seek@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPAUst_mysql_res@@_K@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_fetch_row@4 referenced in function "public: virtual char * * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::fetch_row(struct st_mysql_res *)" (?fetch_row@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAPADPAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_fetch_lengths@4 referenced in function "public: virtual unsigned long * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::fetch_lengths(struct st_mysql_res *)" (?fetch_lengths@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAKPAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_fetch_field@4 referenced in function "public: virtual struct st_mysql_field * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::fetch_field(struct st_mysql_res *)" (?fetch_field@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_field@@PAUst_mysql_res@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_real_escape_string@16 referenced in function "public: virtual unsigned long __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::real_escape_string(struct st_mysql *,char *,char const *,unsigned long)" (?real_escape_string@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEKPAUst_mysql@@PADPBDK@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_debug@4 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::debug(char const *)" (?debug@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPBD@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_init@4 referenced in function "public: virtual struct st_mysql_stmt * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_init(struct st_mysql *)" (?stmt_init@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_stmt@@PAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_prepare@12 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_prepare(struct st_mysql_stmt *,char const *,unsigned long)" (?stmt_prepare@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql_stmt@@PBDK@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_execute@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_execute(struct st_mysql_stmt *)" (?stmt_execute@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_fetch@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_fetch(struct st_mysql_stmt *)" (?stmt_fetch@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_store_result@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_store_result(struct st_mysql_stmt *)" (?stmt_store_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_param_count@4 referenced in function "public: virtual unsigned long __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_param_count(struct st_mysql_stmt *)" (?stmt_param_count@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEKPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_attr_set@12 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_attr_set(struct st_mysql_stmt *,enum enum_stmt_attr_type,void const *)" (?stmt_attr_set@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql_stmt@@W4enum_stmt_attr_type@@PBX@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_bind_param@8 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_bind_param(struct st_mysql_stmt *,struct st_mysql_bind *)" (?stmt_bind_param@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql_stmt@@PAUst_mysql_bind@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_bind_result@8 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_bind_result(struct st_mysql_stmt *,struct st_mysql_bind *)" (?stmt_bind_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql_stmt@@PAUst_mysql_bind@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_close@4 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_close(struct st_mysql_stmt *)" (?stmt_close@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_free_result@4 referenced in function "public: virtual bool __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_free_result(struct st_mysql_stmt *)" (?stmt_free_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAE_NPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_send_long_data@16 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_send_long_data(struct st_mysql_stmt *,unsigned int,char const *,unsigned long)" (?stmt_send_long_data@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql_stmt@@IPBDK@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_result_metadata@4 referenced in function "public: virtual struct st_mysql_res * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_result_metadata(struct st_mysql_stmt *)" (?stmt_result_metadata@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPAUst_mysql_res@@PAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_errno@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_errno(struct st_mysql_stmt *)" (?stmt_errno@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_error@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_error(struct st_mysql_stmt *)" (?stmt_error@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_sqlstate@4 referenced in function "public: virtual char const * __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_sqlstate(struct st_mysql_stmt *)" (?stmt_sqlstate@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEPBDPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_data_seek@12 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_data_seek(struct st_mysql_stmt *,unsigned __int64)" (?stmt_data_seek@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPAUst_mysql_stmt@@_K@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_num_rows@4 referenced in function "public: virtual unsigned __int64 __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_num_rows(struct st_mysql_stmt *)" (?stmt_num_rows@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAE_KPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_affected_rows@4 referenced in function "public: virtual unsigned __int64 __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_affected_rows(struct st_mysql_stmt *)" (?stmt_affected_rows@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAE_KPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_field_count@4 referenced in function "public: virtual unsigned int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_field_count(struct st_mysql_stmt *)" (?stmt_field_count@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEIPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_commit@4 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::commit(struct st_mysql *)" (?commit@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_rollback@4 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::rollback(struct st_mysql *)" (?rollback@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_autocommit@8 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::autocommit(struct st_mysql *,char)" (?autocommit@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql@@D@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_more_results@4 referenced in function "public: virtual char __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::more_results(struct st_mysql *)" (?more_results@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEDPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_next_result@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::next_result(struct st_mysql *)" (?next_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_stmt_next_result@4 referenced in function "public: virtual int __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::stmt_next_result(struct st_mysql_stmt *)" (?stmt_next_result@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEHPAUst_mysql_stmt@@@Z)
5>mysqlcppconn-static.lib(mysql_client_api.obj) : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function "public: virtual void __thiscall sql::mysql::NativeAPI::LibmysqlStaticProxy::close(struct st_mysql *)" (?close@LibmysqlStaticProxy@NativeAPI@mysql@sql@@UAEXPAUst_mysql@@@Z)

如果您不想计数:其中有64个.我注意到,我已经安装了64位版本的C ++连接器源和32位版本的C连接器,所以我安装了64位C连接器,链接器错误恰好翻了一番(128).

In case you dont want to count: Theres 64 of them. I noticed, that I had installed the 64bit Version of the C++ Connector Source and the 32 bit Version of the C Connector, so I installed the C Connector 64bits and the linker errors exactly doubled (128).

因此,我同时卸载了两者并安装了两者的32位版本,只是返回到上面看到的错误.

So I deinstalled both and installed the 32 bit version of both, only to return to the errors you see above.

我知道有很多问题的人都遇到同样的问题,但是我要么找不到一个可以帮助我的问题,要么就没有问题.

I know there are a bunch of questions out there by people, who have the same problem, but I either was not able to find one that could help me or there is none.

如果您可以指导我解决问题,那就太好了.

If you can point me towards a fix, that'd be great.

感谢您的时间

推荐答案

经过几天的搜索和测试,我发现了问题所在.我很惊讶地看到这种情况自2017年甚至更早开始.

After days of searching and testing, I have found the problem. I am surprised to see that this is going on since 2017 or even earlier.

问题:

MySQL网站上的文档令人困惑,过时且无用.

Documentation on the MySQL website is confusing, outdated and useless.

如果要下载最新的 mysql-connector-c ++-8.0.13-winx64.zip ,则会找到 mysqlcppconn-static.lib 库,该库为64 + MB.您可以在项目BUT中使用此文件,也将需要.dll,并且该文件仅在发行版中构建.

If you are downloading the latest mysql-connector-c++-8.0.13-winx64.zip, you will find the library mysqlcppconn-static.lib which is 64+ MB. You can use this in your project BUT, you will need the .dll as well, and this is built in Release version only.

如果要编译自己的连接器,则仅在具有正确"命令的情况下才可以编译.您可以构建x64的STATIC DEBUG版本以在您的应用程序中工作,并且不需要.dll.

If you want to compile your own connector, you can do so if you have the "right" commands only. You can build STATIC DEBUG versions of x64 to work in your application and no .dll is required.

但是,根据发布的OP,您将遇到上述错误.问题是您需要手动链接 mysqlclient.lib .在哪里找到它?因为在他们的下载页面中,他们说:"Windows:可从Windows Installer获得客户端实用程序包."这是错误的.没有这样的东西.

However you will encounter the above error as per the OP posted. The problem is that you need to manually link mysqlclient.lib. Where to find it ? Because in their downloads page they say: "Windows: The Client Utilities Package is available from the Windows Installer." which is false. There is no such thing.

您必须执行的操作是: MySQL Connector/C(存档版本)并下载 mysql-connector-c-6.1.11-winx64-debug.zip .一旦有了这个,就可以将它们链接到您的项目中:

What you must do is go to: MySQL Connector/C (Archived Versions) and download mysql-connector-c-6.1.11-winx64-debug.zip. Once you have this, you can just link these in your project:

#pragma comment(lib, "mysqlcppconn-static.lib")
#pragma comment(lib, "mysqlclient.lib") // mysql-connector-c-6.1.11-winx64\lib\vs14\debug

您的项目将在Debug x64和VS2017(对于我而言)下编译并正常工作.

And your project will compile and work fine under Debug x64 and VS2017 (in my case).

更多问题:

提到我提到Oracle提供的mysqlcppconn-static.lib有64 + MB的地方?我之所以这样说,是因为当您/我们建立自己的mysql连接器时,该库将只有大约16 MB.

Noticed where I mentioned that the mysqlcppconn-static.lib provided by Oracle has 64+MB ? The reason why I said that is because when you/we build our own mysql connector, the library will have around 16 MB only.

是的,Oracle以某种方式链接了1个lib中的所有内容.但是,它没有用,因为它在Release中并使用多线程DLL(/MD)构建,因此,如果您在Debug模式下处理应用程序,它将无法编译,否则将无法调试任何东西.

Yes, Oracle somehow link everything in 1 lib. However it's useless because it's in Release and build with Multi-threaded DLL (/MD), so if you are working on your application in Debug mode it will not compile OR you won't be able to debug anything.

更多问题:

现在,我们发现了如何在x64和DEBUG下构建此MySQL连接器,它仍然仅在多线程调试DLL(/MDd)下工作.因此,基本上,您不能在/MT或/MTd下构建此/您的应用.

Now we I found out how to build this MySQL Connector under x64 and DEBUG, it's still only working under Multi-threaded Debug DLL (/MDd). So basically you cannot build this/your app under /MT or /MTd.

建立当前MySQL连接器(称为JDBC)的步骤:

Steps to build current MySQL Connector ( JDBC as they call it ):

  • Download the latest master: https://github.com/mysql/mysql-connector-cpp
  • Download the latest JDBC branch: https://github.com/mysql/mysql-connector-cpp/tree/jdbc
  • Copy all contents from mysql-connector-cpp-jdbc to mysql-connector-cpp-master\jdbc
  • Open up x64 Native Tools Command Prompt for VS 2017 and navigate into mysql-connector-cpp-master
  • Run this command ( assuming you want the STATIC DEBUG ):

cmake -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE =调试-DBUILD_STATIC = true -DBUNDLE_DEPENDENCIES = ON -DSTATIC_MSVCRT = OFF -DWITH_JDBC = ON

cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=true -DBUNDLE_DEPENDENCIES=ON -DSTATIC_MSVCRT=OFF -DWITH_JDBC=ON

完成后,通过 mysql-connector-cpp-master \ jdbc 中的资源管理器进行操作,然后 您将看到 MYSQLCPPCONN.sln

Once done, go via explorer in mysql-connector-cpp-master\jdbc and you will see MYSQLCPPCONN.sln

从那里开始构建解决方案,您将在其中找到lib mysql-connector-cpp-master \ jdbc \ driver \ Debug

From there just build the solution, and you will find the lib in mysql-connector-cpp-master\jdbc\driver\Debug

仅此而已,我希望我为解决这个谜团"所做的努力将对某人有所帮助.我衷心希望Oracle开发人员能够醒来,因为我们已经在2019年,因此能够正确地创建解决方案和文档.

That would be all for now, I hope my efforts to solve this "mystery" will help someone. And I sincerely hope that Oracle developers will wake up and create solutions properly and documentation because we are in 2019.

这篇关于MySQL C ++连接器未解决的依赖关系(VS 2015)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆