Results 1 to 2 of 2

Thread: Deployed qt app on Mac can't load mysql driver

  1. #1
    Join Date
    Nov 2015
    Location
    Vermont
    Posts
    52
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Deployed qt app on Mac can't load mysql driver

    Hello,
    I haven't done much deploying of qt apps on Macs (though most of my development is on one) but have generally had success previously. Now I'm using Qt 5.7 and macdeploy qt to create a dmg for an application that requires the QMYSQL plugin. When I install from the dmg on my dev machine (all set up with Qt Creator) then the app runs fine, but when it's installed on a different machine it says "driver not loaded." I think this is related to the fact that I had to use install_name_tool change when initially setting up Qt Creator to make sure that libqsqlmysql.dylib could find libmysqlclient.18.dylib (which was previously not being found and keeping the driver from loading). Now when I run otool -L on libqsqlmysql.dylib in the app bundle on one of the other machines it is downloaded on, it still seems to be looking for libmysqlclient.18.dylib in the same path specific to my dev machine. To me this seems to be likely why the driver is not loading: the plugin is looking for a dependency in the wrong place and therefor failing. Does anybody else have any experience with this or any tips on how I can get more information on the error?

  2. #2
    Join Date
    Nov 2015
    Location
    Vermont
    Posts
    52
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Deployed qt app on Mac can't load mysql driver

    Update: Still broken, more information.
    I used install_name_tool on libqsqmysql.dylib in the release build folder to change the path from the one on my dev machine to @executable_path/../Frameworks/libmysqlclient.20.dylib and made sure there was a copy of libmysqlclient.20.dylib in that folder before running macdeployqt. This is because I have a build folder of an older version of the program using Qt 5.5 that worked perfectly fine, and this was the way it was structured. Unfortunately, this did not solve my problem. I have confirmed that all the sql drivers are in fact listed as available by the application, but they are just not being loaded.
    Last edited by ce_nort; 8th December 2016 at 22:00.

Similar Threads

  1. Qt5.2 can find the mysql driver but can not load it
    By stereoMatching in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2014, 06:04
  2. How to load Mysql driver?
    By adutzu89 in forum Newbie
    Replies: 7
    Last Post: 21st December 2013, 05:14
  3. Qt Creator App launched by run option does not load mysql driver
    By l0ud in forum Qt Tools
    Replies: 0
    Last Post: 19th September 2012, 19:48
  4. cannot load mysql driver
    By saman_artorious in forum Qt Programming
    Replies: 1
    Last Post: 9th July 2012, 02:08
  5. Replies: 2
    Last Post: 3rd May 2012, 14:15

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.