Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-26-2013, 03:09 PM
|
#1
|
|
LQ Newbie
Registered: Jan 2013
Location: Morocco
Distribution: Fedora
Posts: 5
Rep: 
|
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!!
|
|
|
|
01-26-2013, 03:25 PM
|
#2
|
|
Member
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 623
|
Quote:
Originally Posted by lingodeles
I have [...] Qt 4.8 .
[...]
It seems that it isn't a shell command!!!
|
Do you also have qt-devel package?
|
|
|
|
01-26-2013, 04:06 PM
|
#3
|
|
LQ Newbie
Registered: Jan 2013
Location: Morocco
Distribution: Fedora
Posts: 5
Original Poster
Rep: 
|
Yes i have. but i dont know how to use it...
|
|
|
|
01-27-2013, 02:42 AM
|
#4
|
|
Member
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 623
|
Can you post the exact command(s) you are trying to run and whatever error you are getting?
|
|
|
|
01-27-2013, 04:40 AM
|
#5
|
|
LQ Newbie
Registered: Jan 2013
Location: Morocco
Distribution: Fedora
Posts: 5
Original Poster
Rep: 
|
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!
|
|
|
|
01-27-2013, 05:54 AM
|
#6
|
|
Member
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 623
|
Do you know where qmake is installed on your system? May be something like
You'll have to either specify the full path or add the directory to your $PATH.
|
|
|
|
01-27-2013, 06:32 AM
|
#7
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,762
|
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
|
|
|
|
01-27-2013, 07:02 AM
|
#8
|
|
LQ Newbie
Registered: Jan 2013
Location: Morocco
Distribution: Fedora
Posts: 5
Original Poster
Rep: 
|
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...
|
|
|
|
01-27-2013, 09:22 AM
|
#9
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,762
|
*
What exactly is it you are trying to compile ? ?
|
|
|
|
01-27-2013, 09:41 AM
|
#10
|
|
LQ Newbie
Registered: Jan 2013
Location: Morocco
Distribution: Fedora
Posts: 5
Original Poster
Rep: 
|
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!!!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:26 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|