Overview
Features
Download
Documentation
Community
Add-Ons & Services

Build Poco wih MySQL support

Please post support and help requests here.

Build Poco wih MySQL support

Postby dbarzo » 10 Oct 2013, 11:36

Hi,

I know this is a trivial question but I have some doubts.
I'm trying to build Poco with MySQL support (VS2010).
I downloaded the MySQL community edition and I installed the server (which has the headers and libs).
The I change the buildwin.cmd like:

Code: Select all
set MYSQL_DIR="C:\Programmi\MySQL\MySQL Server 5.6"
set MYSQL_INCLUDE=%MYSQL_DIR%\include
set MYSQL_LIB=%MYSQL_DIR%\lib

set INCLUDE=%INCLUDE%;%OPENSSL_INCLUDE%;%MYSQL_INCLUDE%
set LIB=%LIB%;%OPENSSL_LIB%;%MYSQL_LIB%


But it does not found the 'mysql.h'

Also I noted that in the server's lib folder I have three files: libmysql.dll and libmysql.lib for dynamic link and mysqlclient.lib for static link.
Since Poco is always linked to libmysql.lib...is there a way to use the static linking?

Thanks in advance for the suggestions,
Daniele.
dbarzo
 
Posts: 37
Joined: 14 Jan 2013, 17:15
Location: Italy

Re: Build Poco wih MySQL support

Postby dbarzo » 10 Oct 2013, 12:21

Putting the inlcude e lib folders into a path without spaces (eg D:\libs\MySQL), it compiles...
But when I build my application (using POCO_STATIC and POCO_NO_AUTOMATIC_LIBS) I get unresolved linker errors:

Code: Select all
1>PocoDataMySQLmdd.lib(Connector.obj) : error LNK2019: unresolved external symbol _mysql_server_init@12 referenced in function "public: static void __cdecl Poco::Data::MySQL::Connector::registerConnector(void)" (?registerConnector@Connector@MySQL@Data@Poco@@SAXXZ)
1>PocoDataMySQLmdd.lib(Connector.obj) : error LNK2019: unresolved external symbol _mysql_server_end@0 referenced in function "public: static void __cdecl Poco::Data::MySQL::Connector::unregisterConnector(void)" (?unregisterConnector@Connector@MySQL@Data@Poco@@SAXXZ)
1>PocoDataMySQLmdd.lib(SessionImpl.obj) : error LNK2019: unresolved external symbol _mysql_insert_id@4 referenced in function "public: class Poco::Any __thiscall Poco::Data::MySQL::SessionImpl::getInsertId(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getInsertId@SessionImpl@MySQL@Data@Poco@@QAE?AVAny@4@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PocoDataMySQLmdd.lib(SessionHandle.obj) : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "public: __thiscall Poco::Data::MySQL::SessionHandle::SessionHandle(struct st_mysql *)" (??0SessionHandle@MySQL@Data@Poco@@QAE@PAUst_mysql@@@Z)
1>PocoDataMySQLmdd.lib(SessionHandle.obj) : error LNK2019: unresolved external symbol _mysql_options@12 referenced in function "public: void __thiscall Poco::Data::MySQL::SessionHandle::options(enum mysql_option)" (?options@SessionHandle@MySQL@Data@Poco@@QAEXW4mysql_option@@@Z)
1>PocoDataMySQLmdd.lib(SessionHandle.obj) : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "public: void __thiscall Poco::Data::MySQL::SessionHandle::connect(char const *,char const *,char const *,char const *,unsigned int)" (?connect@SessionHandle@MySQL@Data@Poco@@QAEXPBD000I@Z)
1>PocoDataMySQLmdd.lib(SessionHandle.obj) : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function "public: void __thiscall Poco::Data::MySQL::SessionHandle::close(void)" (?close@SessionHandle@MySQL@Data@Poco@@QAEXXZ)
1>PocoDataMySQLmdd.lib(SessionHandle.obj) : error LNK2019: unresolved external symbol _mysql_real_query@12 referenced in function "public: void __thiscall Poco::Data::MySQL::SessionHandle::query(char const *)" (?query@SessionHandle@MySQL@Data@Poco@@QAEXPBD@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_stmt_errno@4 referenced in function "public: __thiscall Poco::Data::MySQL::StatementException::StatementException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql_stmt *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0StatementException@MySQL@Data@Poco@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAUst_mysql_stmt@@0@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_errno@4 referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Poco::Data::MySQL::ConnectionException::compose(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql *)" (?compose@ConnectionException@MySQL@Data@Poco@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV56@PAUst_mysql@@@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_sqlstate@4 referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Poco::Data::MySQL::ConnectionException::compose(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql *)" (?compose@ConnectionException@MySQL@Data@Poco@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV56@PAUst_mysql@@@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Poco::Data::MySQL::ConnectionException::compose(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql *)" (?compose@ConnectionException@MySQL@Data@Poco@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV56@PAUst_mysql@@@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_stmt_sqlstate@4 referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Poco::Data::MySQL::StatementException::compose(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql_stmt *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?compose@StatementException@MySQL@Data@Poco@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV56@PAUst_mysql_stmt@@0@Z)
1>PocoDataMySQLmdd.lib(MySQLException.obj) : error LNK2019: unresolved external symbol _mysql_stmt_error@4 referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Poco::Data::MySQL::StatementException::compose(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct st_mysql_stmt *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?compose@StatementException@MySQL@Data@Poco@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV56@PAUst_mysql_stmt@@0@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_init@4 referenced in function "public: __thiscall Poco::Data::MySQL::StatementExecutor::StatementExecutor(struct st_mysql *)" (??0StatementExecutor@MySQL@Data@Poco@@QAE@PAUst_mysql@@@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_close@4 referenced in function "public: __thiscall Poco::Data::MySQL::StatementExecutor::~StatementExecutor(void)" (??1StatementExecutor@MySQL@Data@Poco@@QAE@XZ)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_prepare@12 referenced in function "public: void __thiscall Poco::Data::MySQL::StatementExecutor::prepare(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?prepare@StatementExecutor@MySQL@Data@Poco@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_bind_param@8 referenced in function "public: void __thiscall Poco::Data::MySQL::StatementExecutor::bindParams(struct st_mysql_bind *,unsigned int)" (?bindParams@StatementExecutor@MySQL@Data@Poco@@QAEXPAUst_mysql_bind@@I@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_param_count@4 referenced in function "public: void __thiscall Poco::Data::MySQL::StatementExecutor::bindParams(struct st_mysql_bind *,unsigned int)" (?bindParams@StatementExecutor@MySQL@Data@Poco@@QAEXPAUst_mysql_bind@@I@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_bind_result@8 referenced in function "public: void __thiscall Poco::Data::MySQL::StatementExecutor::bindResult(struct st_mysql_bind *)" (?bindResult@StatementExecutor@MySQL@Data@Poco@@QAEXPAUst_mysql_bind@@@Z)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_execute@4 referenced in function "public: void __thiscall Poco::Data::MySQL::StatementExecutor::execute(void)" (?execute@StatementExecutor@MySQL@Data@Poco@@QAEXXZ)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_fetch@4 referenced in function "public: bool __thiscall Poco::Data::MySQL::StatementExecutor::fetch(void)" (?fetch@StatementExecutor@MySQL@Data@Poco@@QAE_NXZ)
1>PocoDataMySQLmdd.lib(StatementExecutor.obj) : error LNK2019: unresolved external symbol _mysql_stmt_fetch_column@16 referenced in function "public: bool __thiscall Poco::Data::MySQL::StatementExecutor::fetchColumn(unsigned int,struct st_mysql_bind *)" (?fetchColumn@StatementExecutor@MySQL@Data@Poco@@QAE_NIPAUst_mysql_bind@@@Z)
1>PocoDataMySQLmdd.lib(ResultMetadata.obj) : error LNK2019: unresolved external symbol _mysql_fetch_fields@4 referenced in function "public: void __thiscall Poco::Data::MySQL::ResultMetadata::init(struct st_mysql_stmt *)" (?init@ResultMetadata@MySQL@Data@Poco@@QAEXPAUst_mysql_stmt@@@Z)
1>PocoDataMySQLmdd.lib(ResultMetadata.obj) : error LNK2019: unresolved external symbol _mysql_num_fields@4 referenced in function "public: void __thiscall Poco::Data::MySQL::ResultMetadata::init(struct st_mysql_stmt *)" (?init@ResultMetadata@MySQL@Data@Poco@@QAEXPAUst_mysql_stmt@@@Z)
1>PocoDataMySQLmdd.lib(ResultMetadata.obj) : error LNK2019: unresolved external symbol _mysql_stmt_result_metadata@4 referenced in function "public: __thiscall `anonymous namespace'::ResultMetadataHandle::ResultMetadataHandle(struct st_mysql_stmt *)" (??0ResultMetadataHandle@?A0x6a94c790@@QAE@PAUst_mysql_stmt@@@Z)
1>PocoDataMySQLmdd.lib(ResultMetadata.obj) : error LNK2019: unresolved external symbol _mysql_free_result@4 referenced in function "public: __thiscall `anonymous namespace'::ResultMetadataHandle::~ResultMetadataHandle(void)" (??1ResultMetadataHandle@?A0x6a94c790@@QAE@XZ)


where I wrong?
dbarzo
 
Posts: 37
Joined: 14 Jan 2013, 17:15
Location: Italy

Re: Build Poco wih MySQL support

Postby dbarzo » 10 Oct 2013, 12:56

Ops...I forgot to link my project to libmysql.lib :-)
dbarzo
 
Posts: 37
Joined: 14 Jan 2013, 17:15
Location: Italy


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron