Touday I tray to resolve this QMSQL
But no chance with qmake
I recive next message qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
Error processing project file: /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro
and QT will not make application witout this mysql driver
I have ubuntu and QT4
Can somebody help
Please
I use
for entering as root
Maybe, there is a problem with your mysql.pro. Can you attach it here?
I don't have mysql.pro
that file is not available on my Ubuntu,
What i mean is this /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro. If mysql.pro doesn't exist, i assume you install Qt from your package management. Maybe you can search Qt MySQL plugin package using synaptic or something like that.
Last edited by saa7_go; 24th July 2010 at 21:05. Reason: updated contents
yes, I was install Qt from synaptic install manager
I install all package but mysql.pro is not present
and I have qt4 and qt3, can this make problems
I have look in synaptic and I have Qt mysql driver, it is installed at my Ubuntu
Qt4 Mysql database driver - this is name of synaptic package
So, you don't need to rebuilt Qt MySQL driver. Try to create simple application using MySQL driver.
Last edited by saa7_go; 24th July 2010 at 21:55. Reason: updated contents
I try to create simply application Qt and Mysql
and there I find some unexpected problems.
I make one project on C not C++, and it work, but this is not from QT, simply C code from gedit and gcc
I have one project in QT
one file is
connector.h
Qt Code:
#ifndef CONNECTOR_H #define CONNECTOR_H #include <QSqlDatabase> #include <QMessageBox> bool createConnection() { { db.setHostName("localhost"); db.setDatabaseName("test"); db.setUserName("user"); db.setPassword("pass"); if (!db.open()) { QMessageBox m; m.setText("Greska I"); m.exec(); return false; } else { return true; } } else { QMessageBox m; m.setText("Nema drajver za DB"); m.exec(); return false; } } #endif // CONNECTOR_HTo copy to clipboard, switch view to plain text mode
and main.cpp
Qt Code:
#include <QtGui/QApplication> #include "mainwindow.h" #include "connector.h" int main(int argc, char *argv[]) { if(!createConnection()) return 1; MainWindow w; w.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
and this project not work at QT
Bookmarks