Results 1 to 13 of 13

Thread: QMYSQL driver not loaded

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMYSQL driver not loaded

    http://www.qtcentre.org/forum/faq.ph...lugin_category
    [wiki]Building the QMYSQL plugin on Windows using MinGW[/wiki]

  2. #2
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    Quote Originally Posted by wysota View Post
    http://www.qtcentre.org/forum/faq.ph...lugin_category
    [wiki]Building the QMYSQL plugin on Windows using MinGW[/wiki]
    I have no idea why keep getting the "undefined reference " such as following:
    Qt Code:
    1. C:/Qt/4.4.3/src/corelib/plugin/quuid.cpp:566: undefined reference to `CoCreateGu
    2. id@4'
    3. ./tmp\obj\debug_shared\qeventdispatcher_win.o(.text+0x2ac5): In function `ZN28QE
    4. ventDispatcherWin32Private16doWsaAsyncSelectEi':
    5. C:/Qt/4.4.3/src/corelib/kernel/qeventdispatcher_win.cpp:619: undefined reference
    6. to `WSAAsyncSelect@16'
    To copy to clipboard, switch view to plain text mode 
    the last thing i tried was calling mingw32-make after following instructions at "MinGW tips"
    section of:
    http://wiki.qtcentre.org/index.php?t...ws_using_MinGW

    i'm stuck!

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMYSQL driver not loaded

    What exactly step by step did you do? Please include details such as names of archives you downloaded and info about your environment.

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

    sepehr (11th December 2008)

  5. #4
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    i installed mysql in c:\mysql,
    include files are installed and are located in C:\MYSQL\include
    lib files are in C:\MYSQL\lib\opt
    i didn't have reimp utility so i downloaded it from sourceforge and put it in bin directory of mingw(later i put it in qt bin directory too)
    then I did
    dos Code:
    1. cd C:\MYSQL\lib\opt
    2. reimp libmysql.lib
    To copy to clipboard, switch view to plain text mode 
    then cd into C:\Qt\4.4.3\src\plugins\sqldrivers\mysql and then i run
    dos Code:
    1. qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\opt\liblibmysql.a" mysql.pro
    To copy to clipboard, switch view to plain text mode 
    and while i'm in C:\Qt\4.4.3\src\plugins\sqldrivers\mysql directory i run make command
    some stuff go well at first but i get these undefined reference erros
    Qt Code:
    1. tmp/obj/debug_shared/moc_qsql_mysql.o(.rdata$_ZTV12QMYSQLDriver[vtable for QMYSQ
    2. LDriver]+0x7c):c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4
    3. .2/bits/locale_facets.tcc:2502: undefined reference to `QSqlDriver::setLastError
    4. (QSqlError const&)'
    To copy to clipboard, switch view to plain text mode 
    what could be wrong?couldn't this be a version conflict of mingw,qt or mysql?
    i have to get mysql driver running,what else can i do? any other solutions?
    --
    thanks again
    Last edited by wysota; 2nd January 2009 at 23:18.

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMYSQL driver not loaded

    I would try running configure with options to enable mysql support and then cd into the directory containing the plugin and run make there. There might have been some changes in Qt that modified the way plugins are build and those instructions might be wrong.

  7. #6
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    Quote Originally Posted by wysota View Post
    I would try running configure with options to enable mysql support and then cd into the directory containing the plugin and run make there. There might have been some changes in Qt that modified the way plugins are build and those instructions might be wrong.
    i did that,the same errors cameup,

  8. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    are you sure that this file name is correct 'liblibmysql.a'? maybe 'libmysql.a'?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. #8
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    Quote Originally Posted by spirit View Post
    are you sure that this file name is correct 'liblibmysql.a'? maybe 'libmysql.a'?
    yes I'm sure it's liblibmysql.a,i checked it

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMYSQL driver not loaded

    It really should be libmysql.a...

  11. #10
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    there was just a versioning issue and the problem got fixed by upgrading mysql server and I could make those mysql drivers DLLs ,now is there anything other than DLL files that I should ship ? because I get the same error on other machines trying to execute my program despite of having the DLLs

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMYSQL driver not loaded

    You should ship the Qt MySQL driver (qmysql.dll) and MySQL client library (mysqlclient.dll or mysql.dll or something like that). The driver has to be placed in the sqldrivers subdirectory of your application's installation directory and MySQL library either in the installation directory or in a system directory (like C:\Windows\System32).

  13. The following user says thank you to wysota for this useful post:

    sepehr (11th January 2009)

  14. #12
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMYSQL driver not loaded

    Quote Originally Posted by wysota View Post
    You should ship the Qt MySQL driver (qmysql.dll) and MySQL client library (mysqlclient.dll or mysql.dll or something like that). The driver has to be placed in the sqldrivers subdirectory of your application's installation directory and MySQL library either in the installation directory or in a system directory (like C:\Windows\System32).
    from QT docs
    Plugins work differently to normal DLLs, so we can't just copy them into the same directory as our application's executable as we did with the Qt DLLs. When looking for plugins, the application searches in a plugins subdirectory inside the directory of the application executable.

    So to make the plugins available to our application, we have to create the plugins subdirectory and copy over the relevant DLLs:

    plugins\pnp_basictools.dll
    plugins\pnp_extrafilters.dll
    it was not mentioned that sql drivers DLL files should be put in a subdirectory called sqldrivers within plugins directory,thanks wysota

Similar Threads

  1. QSqlDatabase: QMYSQL driver not loaded
    By onder in forum Newbie
    Replies: 12
    Last Post: 29th March 2017, 14:43
  2. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  3. mysql 5 connection
    By GuL in forum Newbie
    Replies: 37
    Last Post: 18th August 2008, 15:11
  4. SQlite driver not loaded error
    By ibergmark in forum Installation and Deployment
    Replies: 2
    Last Post: 17th March 2008, 01:09
  5. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 17:10

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.