PDA

View Full Version : mysql on linux x64



JeanC
23rd February 2011, 17:32
Hello,

I am trying to compile the example program at ~/qtsdk-2010.05/qt/src/plugins/sqldrivers/mysql
When I run it I get an error 'mysql.h not found at qsql_mysql.h line 52'.
When I replace that line with '#include "/usr/include/mysql/mysql.h"' I get an error 'Could not find executable, please specify one'.

I hope it's possible to use mysql on linux in QT without doing daily voodoo rituals.

Help appreciated, thanks.

schnitzel
23rd February 2011, 18:19
just making sure... you did install the mysql development files on that machine - right?

JeanC
24th February 2011, 09:51
Thanks

I did install libmysqlclient16-dev yes.



jean@server:~$ dpkg -l |grep mysqlclient
ii libmysqlclient-dev 5.1.41-3ubuntu12.9 MySQL database development files
ii libmysqlclient16 5.1.41-3ubuntu12.9 MySQL database client library
ii libmysqlclient16-dev 5.1.41-3ubuntu12.9 MySQL database development files - empty tra

JeanC
25th February 2011, 07:24
bump. No one can help me with this?

schnitzel
28th February 2011, 19:31
The directory you are referring to in your first post is not a mysql example program. It is the plugin driver for connecting to a mysql db from a Qt application.

Please have a look at this: http://doc.qt.nokia.com/4.7/qsqldatabase.html#details

then this: http://doc.qt.nokia.com/4.7/sql-driver.html#supported-databases
especially the part about building the plugins manually.

good luck

JeanC
7th March 2011, 09:04
Thanks.
Sorry it took so long to reply.

I am stuck building the plugin, some path setting incorrect?


jean@server:~/qtsdk-2010.05/qt/src/plugins/sqldrivers/mysql$ make
g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/local/include -I. -o main.o main.cpp
main.cpp:42:30: error: qsqldriverplugin.h: No such file or directory
main.cpp:43:25: error: qstringlist.h: No such file or directory
In file included from main.cpp:44:

schnitzel
7th March 2011, 20:14
have you installed libqt4-sql-mysql yet?

ChrisW67
7th March 2011, 21:35
The compiler is not finding files fundamental to Qt (i.e. for QStringList). Are you running the build commands from a shell that has the Qt SDK environment established in it? I've never used the bundled Qt SDK for Linux, but I imagine there's a script to set up the environment... perhaps called qtenv.

If you continue to experience problems you'll need to post the actual commands you are executing and their actual output. Cut and paste.

schnitzel
8th March 2011, 17:34
please don't double post - other thread is:
http://www.qtcentre.org/threads/39406-building-mysql-plugin?p=181062#post181062

and seems to be solved

Lykurg
9th March 2011, 18:55
Thread closed. Discussion can go on in the thread schnitzel pointed to!