LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Connecting MySQL database to Qt under Linux (https://www.linuxquestions.org/questions/programming-9/connecting-mysql-database-to-qt-under-linux-4175447362/)

lingodeles 01-26-2013 03:09 PM

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!!

millgates 01-26-2013 03:25 PM

Quote:

Originally Posted by lingodeles (Post 4878152)
I have [...] Qt 4.8 .
[...]
It seems that it isn't a shell command!!!

Do you also have qt-devel package?

lingodeles 01-26-2013 04:06 PM

Yes i have. but i dont know how to use it...

millgates 01-27-2013 02:42 AM

Can you post the exact command(s) you are trying to run and whatever error you are getting?

lingodeles 01-27-2013 04:40 AM

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!

millgates 01-27-2013 05:54 AM

Do you know where qmake is installed on your system? May be something like

Code:

/usr/lib/qt4/qmake
You'll have to either specify the full path or add the directory to your $PATH.

knudfl 01-27-2013 06:32 AM

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

lingodeles 01-27-2013 07:02 AM

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...

knudfl 01-27-2013 09:22 AM

*


What exactly is it you are trying to compile ? ?

lingodeles 01-27-2013 09:41 AM

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.