[Interest] Problem using mariadb client lib (LGPL) when compiling Qt5

Petric Frank pfrank at gmx.de
Wed Dec 19 16:15:38 CET 2012


Hello Bo,

Am Mittwoch, 19. Dezember 2012, 12:58:21 schrieb Bo Thorsen:
> Hi Petric,
> 
> Den 19-12-2012 07:55, Petric Frank skrev:
> > i tried to compile Qt5 (platform: Windows) using mingw with mysql plugin
> > enabled.
> > 
> > But it fails telling that the preprocessor variable MAX_BIGINT_WIDTH is
> > not defined.
> > 
> > The last lines of the compile output looks like this:
> > ------------------------------ cut ---------------------------------
> > C:\qt-5.0.0-beta2\qtbase\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII
> > -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_DLL -DQT_PLUGIN
> > -DQT_SQL_LIB - DQT_CORE_LIB
> > -IC:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\plugins\sqldriv
> > ers\mysql -I"C:\mariadb_client-1.0.0-win32\mariadbclient\include"
> > -I"..\..\..\..\include" -I"..\..\..\.. \include\QtSql"
> > -I"..\..\..\..\include\QtSql\5.0.0"
> > -I"..\..\..\..\include\QtSql\5.0.0\QtSql" -I"..\..\..\..\include\QtCore"
> > -I"tmp\moc\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -D
> > __GNUC__ -DWIN32
> > C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql
> > \qsql_mysql.cpp -o tmp\moc\debug_shared\qsql_mysql.moc g++ -c -pipe
> > -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wall
> > -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII
> > -DQT_NO_EXCEPTIONS - DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB
> > -IC:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\plugins\sqldriv
> > ers\mysql -I"C:\mariadb_client-1.0.0- win32\mariadbclient\include"
> > -I"..\..\..\..\include" -I"..\..\..\..\include\QtSql"
> > -I"..\..\..\..\include\QtSql\5.0.0"
> > -I"..\..\..\..\include\QtSql\5.0.0\QtSql" -I"..\..\..\..\include\QtCore"
> > -I"tmp\moc\de bug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o
> > tmp\obj\debug_shared\qsql_mysql.o
> > C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql
> > \qsql_mysql.cpp
> > C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql
> > \qsql_mysql.cpp: In member function 'bool
> > QMYSQLResultPrivate::bindInValues()':
> > C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql
> > \qsql_mysql.cpp:386:37: error: 'MAX_BIGINT_WIDTH' was not declared in
> > this scope mingw32-make[11]: *** [tmp/obj/debug_shared/qsql_mysql.o]
> > Error 1 mingw32-make[11]: Leaving directory
> > `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql'
> > mingw32-make[10]: *** [debug-all] Error 2
> > mingw32-make[10]: Leaving directory
> > `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql' mingw32-make[9]:
> > *** [all] Error 2
> > mingw32-make[9]: Leaving directory
> > `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql' mingw32-make[8]:
> > *** [sub-mysql-make_first] Error 2
> > mingw32-make[8]: Leaving directory
> > `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers' mingw32-make[7]: ***
> > [all] Error 2
> > mingw32-make[7]: Leaving directory
> > `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers' mingw32-make[6]: ***
> > [sub-sqldrivers-make_first] Error 2
> > ------------------------------ cut ---------------------------------
> > 
> > Inspecting the include file mysql_com.h from both mysql (Oracle) and
> > mariadb that the first contains the definitions whereas the latter not.
> > 
> > I haven't checked this by compiling Qt 4.8.1, but viewing in the sources
> > this will also a problem there.
> > 
> > Any hints on how to (legally) solve this issue ?
> 
> The MariaDB C library has been diverging from the MySQL C library. At
> some point I guess someone will contribute a driver for Qt.
> 
> But until then, you have to use the MySQL plugin and compile it against
> MySQL. It will work without problems with a MariaDB.
> 
> Slightly annoying and confusing, yes. But it's a usable workaround for
> now. I don't know if there is enough optimizations available when using
> the MariaDB library directly, for anyone to do the effort of maintaining
> a separate plugin.
> 
> Also, it's not without problems to have a MariaDB plugin. Because it
> would be a bit confusing that both the MySQL and MariaDB plugin can talk
> to MariaDB. But the MariaDB plugin can't (I think, but I'm not sure)
> talk to MySQL.
> 
> Legally, there are no issues here. It's only a code and maintenance
> problem.

According to (if i read it coorectly - english is not my mother tongue)

  http://blog.mariadb.org/monty-program-skysql-release-the-mariadb-client-
library-for-c-and-mariadb-client-library-for-java-applications/

this client is for mariadb and mysql.

The advantage is that Digia could bundle this library precompiled with its Qt 
releases.

This would save me (and probably others) to manually compile the plugin 
seperately. Only for this i had to install the sources also.

regards
  Petric



More information about the Interest mailing list