How to build MySQL component on Windows

Please post support and help requests here.
omatai
Posts: 10
Joined: 19 Feb 2016, 03:59

How to build MySQL component on Windows

Postby omatai » 30 Aug 2017, 03:44

I can build and use the parts of Poco I want... including Data, Data/ODBC, and Data/SQLite... but I cannot build Data/MySQL. (I also cannot build NetSSL_OpenSSL, probably for related reasons.)

In the "Building on Windows" instructions in the Getting Started page (https://pocoproject.org/docs/00200-GettingStarted.html), it is clear that the buildwin.cmd script has to be modified... but not *HOW* it has to be modifed. For example, the default installation folder for the latest release of MySQL (with server version 5.7) is under "C:\Program Files\MySQL\MySQL Server 5.7". I have tried every syntax variation I can think of, but the compiler consistently cannot find "mysql.h" despite it being in "C:\Program Files\MySQL\MySQL Server 5.7\include".

What is the correct syntax to specify "set MYSQL_DIR=?????" in buildwin.cmd? I imagine the spaces in the file path are causing an issue, but I can't work out how to escape them. I have also tried setting the INCLUDE environment variable directly, also without luck. Help?

omatai
Posts: 10
Joined: 19 Feb 2016, 03:59

Re: How to build MySQL component on Windows

Postby omatai » 30 Aug 2017, 06:03

"Do the simplest thing that could possibly work"... which is to ignore the fact that there are spaces and just use:

set MYSQL_DIR=C:\Program Files\MySQL\MySQL Server 5.7

Not sure what happened when I first tried that :-(

After that change, it can find mysql.h successfully... and compiles successfully...but runs into linker trouble - there are a long list of unresolved externals, starting with _mysql_init_server. I would have expected these to be in libmysql.lib, which is explicitly in the compiler command. What am I missing? Has anything changed with recent MySQL versions that Poco has not yet been updated with?

omatai
Posts: 10
Joined: 19 Feb 2016, 03:59

Re: How to build MySQL component on Windows

Postby omatai » 31 Aug 2017, 04:18

What I was missing was that I was building a 32-bit application, but the Windows Installer had installed a 64-bit version of the database & associated include & lib files. This led to a failure to find the functions in the library. Downloading the Connector/C++ package, and then replacing the installed lib & include files with those in the downloaded package seems to work fine.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests

cron