Description:
Hi,
I am trying to build MySQL ODBC driver 8.0 by following the given link:
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation-source-windows.htm...
I downloaded all the prerequisites and I am using Visual Studio 2015 with MySQL Server source code 8.0. I built the connector using cmake command (cmake -G "Visual Studio 14 2015 Win64") and now I am trying to build the solution but I am getting some errors because of MEM_ROOT and CHARSET_INFO struct.
I had some similar redefinition issue about struct 'timespec', but I was able to solve it by adding 'HAVE_STRUCT_TIMESPEC' to Preprocessor Definitions. I am not sure how to overcome these errors.
The errors are:
2>c:\users\dms\downloads\working2015-5.7\mysql-connector-odbc-master\include/sys_main.h(111): error C2371: 'MEM_ROOT': redefinition; different basic types
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(161): note: see declaration of 'MEM_ROOT'
2>c:\users\dms\downloads\working2015-5.7\mysql-connector-odbc-master\include/sys_main.h(478): error C2371: 'CHARSET_INFO': redefinition; different basic types
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(70): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(70): error C2227: left of '->number' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(73): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(73): error C2227: left of '->mbminlen' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(74): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(74): error C2227: left of '->mbmaxlen' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(161): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(161): error C2227: left of '->number' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(172): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(172): error C2227: left of '->mbmaxlen' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(417): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(417): error C2227: left of '->mbminlen' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(417): error C2227: left of '->mbmaxlen' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(528): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(528): error C2227: left of '->cset' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(528): error C2227: left of '->mb_wc' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(529): error C2027: use of undefined type 'CHARSET_INFO'
2> C:\Program Files\MySQL\MySQL Server 8.0\include\mysql.h(298): note: see declaration of 'CHARSET_INFO'
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(529): error C2227: left of '->cset' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(529): error C2227: left of '->wc_mb' must point to class/struct/union/generic type
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(536): error C3536: 'mb_wc': cannot be used before it is initialized
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(536): error C2100: illegal indirection
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(558): error C3536: 'wc_mb': cannot be used before it is initialized
2>C:\Users\dms\Downloads\Working2015-5.7\mysql-connector-odbc-master\util\stringutil.cc(558): error C2100: illegal indirection
How to repeat:
Build solution using: devenv.com MySQL_Connector_ODBC.sln /build Release