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
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    11
    Thanked 32 Times in 29 Posts
    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?

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

    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

  3. #3
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    11
    Thanked 32 Times in 29 Posts
    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?

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

    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

  5. #5
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    11
    Thanked 32 Times in 29 Posts
    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?

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

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    I don't have mysql.pro

    that file is not available on my Ubuntu,

  7. #7
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    11
    Thanked 32 Times in 29 Posts
    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 21:05. Reason: updated contents

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

    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

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

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    Quote Originally Posted by miroslavgojic View Post
    I install all package but mysql.pro is not present.
    and I have qt4 and qt3, can this make problems.
    I'm not sure. But, have you search Qt4 MySQL plugin using synaptic?

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

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    I have look in synaptic and I have Qt mysql driver, it is installed at my Ubuntu

    Qt4 Mysql database driver - this is name of synaptic package

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

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    So, you don't need to rebuilt Qt MySQL driver. Try to create simple application using MySQL driver.
    Last edited by saa7_go; 24th July 2010 at 21:55. Reason: updated contents

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

    Default Re: QMYSQL Driver (undefined symbol: mysql_server_init)

    I try to create simply application Qt and Mysql
    and there I find some unexpected problems.

    I make one project on C not C++, and it work, but this is not from QT, simply C code from gedit and gcc

    I have one project in QT

    one file is

    connector.h
    Qt Code:
    1. #ifndef CONNECTOR_H
    2. #define CONNECTOR_H
    3. #include <QSqlDatabase>
    4. #include <QMessageBox>
    5.  
    6. bool createConnection()
    7. {
    8. if (QSqlDatabase::isDriverAvailable("QMYSQL"))
    9. {
    10. QSqlDatabase db = QSqlDatabase.addDatabase("QMYSQL");
    11. db.setHostName("localhost");
    12. db.setDatabaseName("test");
    13. db.setUserName("user");
    14. db.setPassword("pass");
    15.  
    16. if (!db.open())
    17. {
    18. m.setText("Greska I");
    19. m.exec();
    20. return false;
    21. }
    22. else
    23. {
    24. return true;
    25. }
    26. }
    27. else
    28. {
    29. m.setText("Nema drajver za DB");
    30. m.exec();
    31. return false;
    32. }
    33.  
    34. }
    35.  
    36. #endif // CONNECTOR_H
    To copy to clipboard, switch view to plain text mode 

    and main.cpp

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "mainwindow.h"
    3. #include "connector.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication a(argc, argv);
    8.  
    9. if(!createConnection())
    10. return 1;
    11.  
    12. MainWindow w;
    13. w.show();
    14. return a.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    and this project not work at QT

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, 16:00
  2. Replies: 1
    Last Post: 22nd June 2010, 20:56
  3. QtPlugin and undefined symbol
    By Mikoskay in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2010, 13:04
  4. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 15:35
  5. undefined symbol in library
    By quickNitin in forum General Programming
    Replies: 1
    Last Post: 16th November 2006, 11: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.