Connecting MySQL database to Qt under Linux
Hi. Thank you for that!
I'm programming a Qt application under Linux Fedora, and i want to connect it with a MySQL database. I have the QMySQL, MySQL and Qt 4.8 . I learned that i have to compile the driver. I've try many time to but still not yet. I could not use qmake command. It seems that it isn't a shell command!!! So could someone helps me to do it. I'm stopped here since 2 weeks!! |
Quote:
|
Yes i have. but i dont know how to use it...
|
Can you post the exact command(s) you are trying to run and whatever error you are getting?
|
Of course!
command: qmake "INCLUDEPATH+=/usr/lib64/mysql/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro and error: bash: qmake: command not found... Similar command is: 'make' Then i've try: make "INCLUDEPATH+=/usr/lib64/mysql/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro and the error becomes: ake: *** No rule to make target `mysql.pro'. Stop. Seriouly i didn't understand anything! |
Do you know where qmake is installed on your system? May be something like
Code:
/usr/lib/qt4/qmake |
Fedora, qt-devel-4.x.x :
/usr/lib/qt4/bin/qmake , and /usr/bin/qmake-qt4 You can get a binaries file list with : $ rpm -ql qt-devel | grep bin |
Yes i know it.
It is in: /usr/lib64/qt4/bin/qmake. I specified the full in the command like this: /usr/lib64/qt4/bin/qmake "INCLUDEPATH+=/usr/lib64/mysql/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro and it gives me a new error: Cannot find file: mysql.pro. Which "mysql.pro"? Must i download it again? I've already downloaded the qt-devel package and also the QMysql... |
*
What exactly is it you are trying to compile ? ? |
in fact i want just to connect my Qt application with a MySQL database. For make this connection, i read that i must build the driver in local, that's why i'm doing all that: i really need helps and seriously, even if you have an easier solution, please give it to me. I'm going to be crazy with this Qt/MySQL connection!!!
|
All times are GMT -5. The time now is 03:36 PM. |