Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[Solved]Manually building MySQL driver for newest SDK Download
I've been following "Manually Build QMYSQL":http://doc.qt.nokia.com/latest/sql-driver.html#qmysql but I can't seem to properly build the driver.
Given the following:
- I've downloaded the SDK and installed it to /home/bobby/QtSDK
- I have Qt-4 installed locally, so I'm explicitly calling qmake from the QtSDK directory path
- I am running Fedora 15. My include dir is
/usr/includeand my library path is
/usr/libfor my installed version of MySQL
How can I build the driver if by following the directions I get:
[bobby@localhost myql]$ /home/bobby/QtSDK/Desktop/Qt/473/gcc/bin/qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L /usr/lib -lmysqlclient_r" mysql.pro
[bobby@localhost myql]$ make
g++ -Wl,-O1 -Wl,-rpath,/home/bobby/QtSDK/Desktop/Qt/473/gcc/lib -o mysql -L/home/bobby/QtSDK/Desktop/Qt/473/gcc/lib -L /usr/lib -lmysqlclient_r -lQtGui -lQtCore -lpthread
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql] Error 1
[bobby@localhost myql]$ ls
dangelog last edited by
[quote author="bobby" date="1311801649"]Hi Folks!
I've been following "Manually Build QMYSQL":http://doc.qt.nokia.com/latest/sql-driver.html#qmysql but [/quote]
Sorry, I clicked post instead of preview :)
I decided to post this in the event that this comes up again. Currently (as of today's date) 4.7 is the stable tree.
- Download the Qt 4.7-Stable Source
- Run qt-qt/configure
- Select the Open Source version, and agree to the license after reading it.
- Use configure tool to enable databases.
- Build with @gmake@ and @gmake install@
*EDIT: Also soft link from your built plugins to $QTDIR/Desktop/Qt/473/gcc/plugins/sqldrivers/
Obviously there isn't the src tree to build the drivers in the first place from the SDK .bin file I originally downloaded. If someone else can chime in that it SHOULD be there and I was right to think the documentation applied to the SDK download from the main website I'll file the proper bug report. If I was wrong and the src download is treated different I'll shush up, but only having a SQLight driver is pretty limited.
Thanks Qt devs for a great product, I think I'll stick to building from sources. I appreciate you making them easily available on gitorious! For people who don't know where to find them, click "Qt 4.7-Stable":http://qt.gitorious.org/qt/qt/trees/4.7-stable