Results 1 to 10 of 10

Thread: mysql on linux x64

  1. #1
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default mysql on linux x64

    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.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql on linux x64

    just making sure... you did install the mysql development files on that machine - right?

  3. #3
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql on linux x64

    Thanks

    I did install libmysqlclient16-dev yes.

    Qt Code:
    1. jean@server:~$ dpkg -l |grep mysqlclient
    2. ii libmysqlclient-dev 5.1.41-3ubuntu12.9 MySQL database development files
    3. ii libmysqlclient16 5.1.41-3ubuntu12.9 MySQL database client library
    4. ii libmysqlclient16-dev 5.1.41-3ubuntu12.9 MySQL database development files - empty tra
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql on linux x64

    bump. No one can help me with this?

  5. #5
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql on linux x64

    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-driv...rted-databases
    especially the part about building the plugins manually.

    good luck

  6. The following user says thank you to schnitzel for this useful post:

    JeanC (7th March 2011)

  7. #6
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql on linux x64

    Thanks.
    Sorry it took so long to reply.

    I am stuck building the plugin, some path setting incorrect?
    Qt Code:
    1. jean@server:~/qtsdk-2010.05/qt/src/plugins/sqldrivers/mysql$ make
    2. 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
    3. main.cpp:42:30: error: qsqldriverplugin.h: No such file or directory
    4. main.cpp:43:25: error: qstringlist.h: No such file or directory
    5. In file included from main.cpp:44:
    To copy to clipboard, switch view to plain text mode 

  8. #7
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql on linux x64

    have you installed libqt4-sql-mysql yet?

  9. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: mysql on linux x64

    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.

  10. #9
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql on linux x64

    please don't double post - other thread is:
    http://www.qtcentre.org/threads/3940...062#post181062

    and seems to be solved

  11. #10
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: mysql on linux x64

    Thread closed. Discussion can go on in the thread schnitzel pointed to!

Similar Threads

  1. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11
  2. Mysql plugin on Linux problem
    By .:saeed:. in forum Newbie
    Replies: 1
    Last Post: 20th January 2011, 17:03
  3. [Qt 4.6.3][Linux] MySQL driver compilation
    By Tomasz in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th October 2010, 13:40
  4. MYSQL 5 Table qt model as small Mysql admin
    By patrik08 in forum Qt-based Software
    Replies: 0
    Last Post: 1st May 2007, 09:43
  5. Qt 4.1.4 & Mysql 5 on Linux x64
    By bothapn in forum Installation and Deployment
    Replies: 7
    Last Post: 4th August 2006, 13:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.