Mysql in qt5
-
wrote on 20 Dec 2012, 23:41 last edited by
Hi All.
I have tested my application in Qt5 but I have a problem with mysql driver. It's not installed :-(I tried to compile the drive in Linux, but I have error. This is the command I have used for compile.
@qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro@
And the answer is:
WARNING: /home/arcnexus/Qt5.0.0/5.0.0/Src/qtbase/src/plugins/sqldrivers/qsqldriverbase.pri:4: Unable to find file for inclusion qt_plugin Project MESSAGE: Warning: unknown QT: sql-private
Please anyone know how to compile the driver in Qt5 and Linux?
-
wrote on 21 Dec 2012, 03:45 last edited by
I have the same problem....
Can anybody help us?
Thank in advance.
-
wrote on 23 Dec 2012, 15:29 last edited by
Hi All,
after several hours I've finally found quite a simple solution:
- Open the .pro in src/plugins/sqldrivers/psql (or mysql) with the Qt Creator.
- Modify the include in the Build Settings
- Build
In my case and after a message in the Creator I had to create /plugins temporarily then build again and move the libqsqlpsql.so to Qt5.0.0/5.0.0/gcc_64/plugins/sqldrivers
Works perfect now!
-
wrote on 23 Dec 2012, 15:43 last edited by
Hi clochydd.
Modify de include with.....?
I don't understand.
If I compile mysqldriver. when I build project I obtain this error:
:-1: error: Unknown module(s) in QT: qt
do you know also about this?
-
wrote on 23 Dec 2012, 16:52 last edited by
Hi ArcNexus,
in my case, I had to add "INCLUDEPATH+=/usr/include/postgresql" in the Build section and you should add a similar include for your mysqldriver.
I had lots of error messages like "Unknown modules" etc. - but it was all solved the described way.
I hope this may help you.
-
wrote on 23 Dec 2012, 19:31 last edited by
Thanks :
Yes, the problem is in the paths, I have solved this in part, but where is #include "main.moc"? I have searched this in my / directory but don't find it.
this include is in my main.cpp. :-(
-
wrote on 23 Dec 2012, 22:08 last edited by
-
wrote on 25 Dec 2012, 23:04 last edited by
Thanks clocydd, I have solved it with compiling QBase code cloned from Github, in Archlinux
5/8