Results 1 to 20 of 29

Thread: QMYSQL Driver (undefined symbol: mysql_server_init)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    PL
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default QMYSQL Driver (undefined symbol: mysql_server_init)

    Hello,
    I have problem with app with mysql.
    When I run app with mysql I get:
    Qt Code:
    1. symbol lookup error: /usr/local/Trolltech/QtEmbedded-4.6.2-arm/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: mysql_server_init
    To copy to clipboard, switch view to plain text mode 

    I run app on ARM-board with mysql ver. 14.14 distrib 5.1.40, for angstrom-linux-gnueabi (arm) using EditLine wrapper.

    I built database drivers using:
    Qt Code:
    1. qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysqlclient_r" mysql.pro
    2. make
    To copy to clipboard, switch view to plain text mode 
    on Ubuntu without errors.

    I don't know where is error.. Could you help me?

    thanks,
    Przemek

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Try to recompile the driver using:

    Qt Code:
    1. qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
    2. make
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2010
    Location
    PL
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Quote Originally Posted by saa7_go View Post
    Try to recompile the driver using:

    Qt Code:
    1. qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
    2. make
    To copy to clipboard, switch view to plain text mode 
    in result I get:
    Qt Code:
    1. cannot find -lmysqlclient_r"
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to przemek for this useful post:

    miroslavgojic (20th July 2010)

  5. #4
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Is there any libmysql*.a in /usr/lib?

  6. #5
    Join Date
    Jul 2010
    Location
    PL
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    yes, in /usr/lib I have:
    Qt Code:
    1. -rw-r--r-- 1 root root 2819966 2010-06-07 21:58 libmysqlclient.a
    2. -rw-r--r-- 1 root root 1068 2010-06-07 21:57 libmysqlclient.la
    3. -rw-r--r-- 1 root root 2834652 2010-06-07 21:58 libmysqlclient_r.a
    4. -rw-r--r-- 1 root root 1122 2010-06-07 21:57 libmysqlclient_r.la
    5. lrwxrwxrwx 1 root root 22 2010-07-08 16:31 libmysqlclient_r.so -> libmysqlclient_r.so.16
    6. lrwxrwxrwx 1 root root 26 2010-07-08 16:31 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
    7. -rw-r--r-- 1 root root 2047772 2010-06-07 21:58 libmysqlclient_r.so.16.0.0
    8. lrwxrwxrwx 1 root root 20 2010-07-08 16:31 libmysqlclient.so -> libmysqlclient.so.16
    9. lrwxrwxrwx 1 root root 24 2010-07-08 16:31 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
    10. -rw-r--r-- 1 root root 2039580 2010-06-07 21:58 libmysqlclient.so.16.0.0
    To copy to clipboard, switch view to plain text mode 

  7. #6
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Quote Originally Posted by przemek View Post
    When I run app with mysql I get:
    Qt Code:
    1. symbol lookup error: /usr/local/Trolltech/QtEmbedded-4.6.2-arm/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: mysql_server_init
    To copy to clipboard, switch view to plain text mode 
    I think you successfully build qmysql driver. How did you build it?

  8. #7
    Join Date
    Jul 2010
    Location
    PL
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    My *cpp, *pro files and Makefile in attachments.
    Do you think, that it could be problem with my linux on arm, or ubuntu, qt, or etc.?
    I haven't got any idea how to solve my problem.
    Maybe I should recompile all qt?

    edit:
    I recompile plugin on other computer and copy libqsqlmysql.so to arm-board and now I have message:
    Qt Code:
    1. QSqlDatabase: QMYSQL driver not loaded
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files
    Last edited by przemek; 15th July 2010 at 21:30.

  9. #8
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Quote Originally Posted by przemek View Post
    My *cpp, *pro files and Makefile in attachments.
    Do you think, that it could be problem with my linux on arm, or ubuntu, qt, or etc.?
    I haven't got any idea how to solve my problem.
    Maybe I should recompile all qt?

    edit:
    I recompile plugin on other computer and copy libqsqlmysql.so to arm-board and now I have message:
    Qt Code:
    1. QSqlDatabase: QMYSQL driver not loaded
    To copy to clipboard, switch view to plain text mode 
    I don't know. BTW, Do you use mysql from your host operating system(ubuntu) or angstrom?

  10. #9
    Join Date
    Jul 2010
    Location
    Serbia, Belgrade
    Posts
    13
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Touday I tray to resolve this QMSQL

    But no chance with qmake

    I recive next message qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro

    Error processing project file: /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro

    and QT will not make application witout this mysql driver

    I have ubuntu and QT4

    Can somebody help

    Please

  11. #10
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Quote Originally Posted by miroslavgojic View Post
    Touday I tray to resolve this QMSQL

    But no chance with qmake

    I recive next message qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro

    Error processing project file: /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro

    and QT will not make application witout this mysql driver

    I have ubuntu and QT4

    Can somebody help

    Please
    Do you run qmake as root or using sudo?

  12. #11
    Join Date
    Jul 2010
    Location
    Serbia, Belgrade
    Posts
    13
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    I use

    Qt Code:
    1. $ sudo su
    To copy to clipboard, switch view to plain text mode 

    for entering as root

  13. #12
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Maybe, there is a problem with your mysql.pro. Can you attach it here?

  14. #13
    Join Date
    Jul 2010
    Location
    Serbia, Belgrade
    Posts
    13
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    I don't have mysql.pro

    that file is not available on my Ubuntu,

  15. #14
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    What i mean is this /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro. If mysql.pro doesn't exist, i assume you install Qt from your package management. Maybe you can search Qt MySQL plugin package using synaptic or something like that.
    Last edited by saa7_go; 24th July 2010 at 20:05. Reason: updated contents

  16. #15
    Join Date
    Jul 2010
    Location
    Serbia, Belgrade
    Posts
    13
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    yes, I was install Qt from synaptic install manager

    I install all package but mysql.pro is not present

    and I have qt4 and qt3, can this make problems

Similar Threads

  1. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  2. Replies: 1
    Last Post: 22nd June 2010, 19:56
  3. QtPlugin and undefined symbol
    By Mikoskay in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2010, 12:04
  4. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35
  5. undefined symbol in library
    By quickNitin in forum General Programming
    Replies: 1
    Last Post: 16th November 2006, 10:50

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.