Results 1 to 15 of 15

Thread: SQL Driver not loaded in Release

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default SQL Driver not loaded in Release

    Hi, I'm having a problem with a SQL driver.

    The Sql connection is not done on Release but it connects on Debug.

    The exe dir contains the Qt debug and release libs and I have the "sqldrivers" dir with the debug and release libs inside.

    The connection returns me "Driver not Loaded".

    Thanks,
    Òscar Llarch i Galán

  2. #2
    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: SQL Driver not loaded in Release

    are you sure that yours application (release) don't use debug libs?
    check dependency of application.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    The application dir contains the debug and release libs.
    I checked with "Dependency Walker" and the dir contains the needed libs.

    I have a computer that has the MySQL database and another computer that is the client. I have the application in the client computer. If I exec the application on the client, I get "Driver Not Loaded" error, but If I share the app dir and I exec the application from the server computer(using the shared dir), it works.

    The server computer is the developer computer.

    Thanks,
    Òscar Llarch i Galán

  4. #4
    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: SQL Driver not loaded in Release

    do you use sql-plugins? if yes, then try to copy QTDIR/plugins/sqldrivers dir to yours app directory.

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    I did it as I told you in the first post.

    Thanks,
    Òscar Llarch i Galán

  6. #6
    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: SQL Driver not loaded in Release

    so, you application dir has next structure
    appdir
    |----sqldrivers
    | |---- qsqlmysql4.dll
    | |-----qsqlmysql4d.dll
    |----myapp.exe
    right?

  7. The following user says thank you to spirit for this useful post:

    josepvr (25th February 2009)

  8. #7
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    Yes, in appdir also there are the Qt4 libs
    Òscar Llarch i Galán

  9. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: SQL Driver not loaded in Release

    And the MySQL DLL is in PATH?
    J-P Nurmi

  10. #9
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    Yes, the MySQL is in the Path. AI have also tryied to copy the MySQL release DLL into the appDir and the release app gets the same error and the debug app is connecting well.

    Thanks,
    Òscar Llarch i Galán

  11. #10
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    I have one question that I don't really understand.

    The Envoirment variable "LIB" points to "%MYSQL%\lib\debug".

    When Qt is compiled, the MySQL debug driver is linked on debug lib and MySQL release driver is linked on release lib?

    So when I try to start the application and the Qt MySQL drivers are linked to the debug MySQL lib, the Qt driver don't find the correct MySQL lib.

    Thanks,
    Òscar Llarch i Galán

  12. #11
    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: SQL Driver not loaded in Release

    use path for LIB variable
    LIB=%MYSQL%\lib\opt;

  13. #12
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    Yes, it's what I was thinking.
    So, the opt lib will be linked when compiling the app.

    Thank you very much,

    Another question to Visual Studio users: How can I force to link with different libs? As opt MySQL lib for release and debug MySQL lib for debug?

    Thanks,
    Òscar Llarch i Galán

  14. #13
    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: SQL Driver not loaded in Release

    try to add needed library manually.
    e.g. go to "Project->%1 Properties" (%1 your project name), then go to "Linker->Input" and add in "Additional Dependecies" neede library.

  15. #14
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Hi,

    Fine.

    Thank you very much again.
    Òscar Llarch i Galán

  16. #15
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: SQL Driver not loaded in Release

    Thanks!
    It worked for me!

  17. The following user says thank you to josepvr for this useful post:

    Erik@DK (2nd September 2010)

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. mysql 5 connection
    By GuL in forum Newbie
    Replies: 37
    Last Post: 18th August 2008, 15:11
  3. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 17:10
  4. My Mysql 5 and Qt 4.2.2 Problem (Driver not loaded)
    By fengtian.we in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2007, 08:11
  5. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 09:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.