Results 1 to 6 of 6

Thread: Deploying program with plugin on different computer

  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Deploying program with plugin on different computer

    Hello!
    I'm trying to deploy an application on a computer other than my own and I seem to have some problem with loading the MySQL driver plugin.

    Facts:
    1. I'm using the 2010.05 SDK on a win7 x64 PC for developing. I'm using Qt Creator and MinGW.
    2. I have successfully compiled and used the MySQL-driver on the machine mentioned above.
    3. I have both a qsqlmysqld4.dll and a qsqlmysql4.dll in my C:\Qt\2010.05\qt\plugins\sqldrivers folder so I guess it is successfully built in both debug and release mode. Also I can compile my current "database-list-application" in both debug and release mode with full functionality.
    4. When I use Dependency Walker on the built executable I get the compiler specific dll's (LIBGCC_S_DW2-1.dll and MINGWM10.dll) in the list along with the QtCore4, QtGUI4 and QtSQL4.dll. But I can't find anything about dependencies towards the mysql-plugin/driver dll.

    Questions:
    How do I deploy my application on a different computer?
    I have another machine here using the same OS (with no Qt installs or programs) but I can't get the database connection to work on that one.
    What I have tried is to put the executable (built in release-mode) and all the DLL's listed in dep-walker in the same folder on the target computer and put the qsqlmysql4.dll in a subfolder called 'plugins'. I also tried naming the subfolder 'sqldrivers' and putting the dll-file in 'plugins\sqldrivers' and also directly in the folder with the executable but it all ends up with the database connection not functioning properly.

    I've read the docs about deploying qt plugins but I'm not sure what's wrong here.

    Anyone have any ideas about how to further troubleshoot or, even better, solve this matter?

    Thank you!
    /Tottish

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deploying program with plugin on different computer

    This is the directory structure my deployed application uses:
    Qt Code:
    1. C:\Program Files\
    2. MyProgram\
    3. MyProgram.exe
    4. mingwm10.dll
    5. libgcc_s_dw2-1.dll
    6. QtCore4.dll
    7. QtGui4.dll
    8. ...
    9. sqldrivers\
    10. qsqlite4.dll
    11. imageformats\
    12. ...
    13. iconengines\
    14. ...
    To copy to clipboard, switch view to plain text mode 
    So your general layout was OK. Your Mysql plugin has dependencies of its own on one or more Mysql DLLs that must also be present on the target system. Try running Depends.exe against the Mysql plugin.

  3. The following 2 users say thank you to ChrisW67 for this useful post:

    jfabian (3rd March 2011), Tottish (19th December 2010)

  4. #3
    Join Date
    Dec 2010
    Location
    South Africa
    Posts
    56
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Deploying program with plugin on different computer

    I use mysql drivers for my apps.

    inside you program directory you need to have a directory called sqldrivers/
    inside the put in your qsqlmysql4.dll.

    but dont forget to add libmySQL.dll to the program base directory with your other dll's

    You get the libmySQL.dll from your mysql directory. there might be 2 if i remember, so if one doesnt work try the other.

    Hope this is of help to you

    Regards
    Donovan Hoare

  5. The following user says thank you to ShapeShiftme for this useful post:

    Tottish (19th December 2010)

  6. #4
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying program with plugin on different computer

    Howdy!
    Thanks a lot for the pointers. It was the absent libmysql.dll that was the problem. Why doesn't dependency-walker list the plugin DLLs?... hmmm...

    Tried my app on Win7 64-bit and Xp 32-bit (without recompiling the MySQL plugin) with seemingly full functionality so I guess that it should work on any platform in between which was my goal!
    Thanks a lot guys, I really appreciate it!

    Have a beautiful Sunday!
    /Tottish

  7. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deploying program with plugin on different computer

    Dependency Walker can only list the dependencies that are explicitly encoded in the executable. Plugins are designed to be on-demand loaded so there is nothing in the executable that the can be used to determine if they are actually dependencies or not.

  8. The following user says thank you to ChrisW67 for this useful post:

    Tottish (20th December 2010)

  9. #6
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying program with plugin on different computer

    Ahhh, I see.
    Thank you, Chris, for that very useful information!

    Cheers and Merry Christmas!
    /Tottish

Similar Threads

  1. Replies: 2
    Last Post: 9th December 2010, 14:11
  2. Replies: 3
    Last Post: 8th December 2010, 11:45
  3. Run my program on a different computer?
    By skizzik in forum Installation and Deployment
    Replies: 18
    Last Post: 12th November 2010, 14:26
  4. Replies: 4
    Last Post: 14th June 2007, 05:06

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.