Solved Qt plugins MySQL in Raspbian
-
Hi!
Can you please post the whole build log not just these two lines?
The actual error message must be before this lines. -
make g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -I/usr/include/mysql -O2 -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++ -I. -I/usr/lib/arm-linux-gnueabihf/qt5/MySQL/includeLIBS+=/usr/lib/arm-linux-gnueabihf/qt5/MySQL/lib -I-lmysqlclient_r -isystem /usr/include/arm-linux-gnueabihf/qt5/QtSql/5.3.2 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtSql/5.3.2/QtSql -isystem /usr/include/arm-linux-gnueabihf/qt5 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtSql -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore/5.3.2 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore/5.3.2/QtCore -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore -I.moc -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp ../../../sql/drivers/mysql/qsql_mysql.cpp: In constructor ‘QMYSQLDriverPrivate::QMYSQLDriverPrivate()’: ../../../sql/drivers/mysql/qsql_mysql.cpp:82:51: error: ‘MySqlServer’ is not a member of ‘QSqlDriver’ preparedQuerysEnabled(false) { dbmsType = QSqlDriver::MySqlServer; } ^ Makefile:386: recipe for target '.obj/qsql_mysql.o' failed make: *** [.obj/qsql_mysql.o] Error 1
I got this
-
It looks like you have the same issue (mixing Qt versions):
https://forum.qt.io/topic/55571/problem-to-make-mysql-driver-in-qt-5-4/7 -
I will try a new installation of Qt & MySQL. I will answer you later. Thank for help @jsulm
-
Well, i got a new problem now. I download qt for linux, but the problem is, i can't lunch the .run
-
Hi and welcome to devnet,
You can't use the installer on the Raspberry Pi. The Pi uses an ARM processor and the installers are build of x86/x86_64.
Did you compile Qt for raspbian or are you using a package from the distribution ?
-
@SGaist Im using packages from the distribution. And i try to compil with Qt src and MySQL
-
I just re-read your qmake line to build the plugin. You have a space between -L and your path which is wrong. The -L and -l options both require to have their argument right after.
-
@SGaist I do it again and no error, after the command make install. He said he creat the lib .so on $PathOfQt5/plugins/
And when i tried to run my app he said again QSQLDatabase QMYSQL driver not loaded
& QSQLDatabase : available drivers : QSQLITECan i use the lib for ubuntu 14.0.4 for my raspberry ?
-
No you can't, they are not from the same architecture. You have to compile the plugin with the Qt you are using for your RPi.
-
@SGaist Ok, i do it and not work at all...
with the same error in Qt ...QSQLDatabase QMYSQL driver not loaded
& QSQLDatabase : available drivers : QSQLITE -
Did you check that the plugin was properly installed in your device ?
-
@SGaist Yep he did. Should i copy/paste on my debug folder ?
-
He did ? Who's that ?
What do you mean by
copy/past on my debug folder
? -
-
No, they should be in Qt's installation folder under
plugins/sqldrivers/
-
@SGaist Yeah, they are in the folder sqldrivers as you said. I really don't know how to help you with some indications... :/
-
What do you get if your run
ldd libqsqlmysql.so
on your RPi ? -
@SGaist I got this :
pi@raspberrypi:/usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers $ ldd libqsqlmysql.so
linux-vdso.so.1 (0x7ec39000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f42000)
libmysqlclient.so.18 => /usr/lib/arm-linux-gnueabihf/libmysqlclient.so.18 (0x76c1a000)
libQt5Sql.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Sql.so.5 (0x76bd4000)
libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0x7674f000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76673000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76532000)
/lib/ld-linux-armhf.so.3 (0x54b8f000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76509000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x764e2000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x764cf000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76454000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76427000)
libicui18n.so.52 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.52 (0x76266000)
libicuuc.so.52 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.52 (0x7611e000)
libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x7601b000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76004000)
libicudata.so.52 => /usr/lib/arm-linux-gnueabihf/libicudata.so.52 (0x74987000)
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x74913000) -
Looks fine… Can you start your application with
QT_DEBUG_PLUGINS=1
? To see what happens when your application loads the plugins.