Results 1 to 4 of 4

Thread: How to install plugins, addLibrary path and subdirectories, MySQL Plugin

  1. #1
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post How to install plugins, addLibrary path and subdirectories, MySQL Plugin

    This is an informative post to indicate how I finally got a plugin to work, in particular the MySQL plugin.

    QT says it looks through the library paths for plugins. It also says that the application directory is also added to the library paths. This is however a bit misleading. When it scans for plugins it looks to specific subdirectories in those paths. For example, when looking for SQL driver plugins it is hard-coded to look in the "sqldrivers" subdirectory.

    So this setup will work:

    your_app
    your_app/plugins
    your_app/plugins/sqldrivers

    And then you need to addLibraryPath( "/fullpath/your_app/plugins" ).

    Windows
    To got further however something like the mysql plugin will need libmysql.dll. This will only be searched in the application path and the standard system paths -- this has nothing to do with the library paths in this case. So in the above you need to place this file in the "your_app" directory.

    QT_DEBUG_PLUGINS
    This environment variable yields a bit of useful information. On windows to get it working you're best setting it in the global environment variable settings -- I had difficulty getting it working if just set in a command prompt. The output goes to the installed MsgHandler.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to install plugins, addLibrary path and subdirectories, MySQL Plugin

    You don't have to hard code the path to the plugins. It is enough if you put the MySQL plugin at

    your_app/sqldrivers

    Qt will then find it by it's own. Also if you need to hard code any path at all, better use qt.conf instead of compiling the path in your application.

  3. #3
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to install plugins, addLibrary path and subdirectories, MySQL Plugin

    Yes, that directory also works. From what I have written it is clear as to why it works as well, but many people might prefer to use a "plugins" subdirectory for clarity (as the QT install does).

    I didn't mean to hard-code the path. Obviously you should determine the path at startup with something like:

    QDir plugins( QCoreApplication::applicationDirPath() );
    plugins.cd( "plugins" );
    addLibraryPath( plugins.absolutePath() );

  4. #4

    Default Re: How to install plugins, addLibrary path and subdirectories, MySQL Plugin

    Hi,

    Also struggling with this issue. Managed to compile the mysql plugin and it is working fine with the simulator on pc.
    Problem is with this what you have already solved above, how to get the plugin in to the target device with the application.

    Have in .pro file the following currently:
    ...
    folder_02.source = plugins/sqldrivers
    folder_02.target = plugins/sqldrivers
    DEPLOYMENTFOLDERS += folder_02

    #file_01.sources = libmysql.dll
    #file_01.path = .
    #DEPLOYMENT += file_01
    ...

    Do you know what else needs to be defined in the .pro file for this? Libraries?
    Have the addLibraryPath() already defined in the source pointing to the plugins directory.
    Thanks!

Similar Threads

  1. [WinCE 6] How to install Qt and plugins ?
    By KroMignon in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th July 2010, 08:27
  2. Creating MySQL and Oracle (OCI) plugins.
    By Blando in forum Newbie
    Replies: 3
    Last Post: 15th May 2010, 08:45
  3. QT plugins: a plugin that is a GUI
    By trallallero in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2009, 11:39
  4. Problem with nmake and mysql plugins
    By raken in forum Installation and Deployment
    Replies: 1
    Last Post: 7th July 2007, 08:20
  5. Need to compile with MySQL drivers/plugins
    By mongenix in forum Newbie
    Replies: 5
    Last Post: 6th January 2007, 20:24

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.