QMYSQL driver not loaded error
I've got that error when trying to run a program so I've tried to look for the solution on the web, but I still don't get it fixed. So pls help me.
This is the code I've tried to find out the extractly error.
Code:
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QSqlError>
#include <QStringList>
#include <QtDebug>
int main(int argc, char *argv[])
{
qDebug() << db.lastError();
}
And this is the result:
Code:
("QSQLITE")
QSqlError(-1,
"Driver not loaded",
"Driver not loaded")
my .pro file is:
Code:
QT += sql
SOURCES += main.cpp
I've think i don't have the MySQL driver installed but I don't know how to install it.
I've tried to configure like following:
Code:
qmake "INCLUDEPATH+=-I/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient_r" mysql.pro
and then run make but this is what it return:
Code:
../../../../include/QtCore/../../corelib/arch/qatomic_arch.h:88:4: error: #error "Qt has not been ported to this architecture"
.......
make: *** [.obj/release-shared/main.o] Error 1.
Anyone help me fix this error.
Thanks for your attentions.
P/S: if that is an uninstalled mysql driver error, please tell me how to install it in detail cause i'm totally newbie.
I'm using Redhat Enterprise, Qt 4.5.3 and MySQL 5
Re: QMYSQL driver not loaded error
OK! My problem is fixed. It seems my install packet is error. I re-uncompress my qt packet, reconfigure and run qmake qmake install. It took approximately 3 hours to install and finally my program worked. Thanks alot