Results 1 to 11 of 11

Thread: Application Plugins in Windows [XP]

  1. #1
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Application Plugins in Windows [XP]

    First off, i have no problem in Linux with this stuff running.

    Now the background, I have developed an app that loads plugins from the 'plugins' directory of my applications exe directory in windows. It works fine on the development machine, and also on another Windows XP running SP1. However, i have another machine setup running a fresh windows installation. Fresh install with nothing done to it. I have all the necessary .dll files (QtCore4.dll QtGui4.dll, msvcr80.dll, etc.) in the .exe directory (app directory). There is no problem running the program. It's that the dynamically loaded plugins will NOT load.

    Even more info: when i changed my code to not look in "./plugins" but actually look in "./" and moved the .dll files to that directory, they loaded. But this makes no sense to me.

    Now, i've looked EVERYWHERE for a solution to this and i cannot find anything. No one seems to have had this problem which i find hard to believe. I have read as much as i can from the msdn library but it's just so boring and nothing there seems to help.

    I can rule out a few things: It's not my app. You can reproduce this behavior with the plugandpaint app. It also will NOT load the plugins from the "plugins" directory.

    Raw Problem: Plugins will not load when in a subdirectory of the main exe and dependency dll's.

    Reproducing: Just use a fresh install of windows w/out QT4 and copy over the plugandpaint app which you compiled on another windows machine.

    Frustrating the crap out of me. Please let me know what's up.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    Try creating a "qt.conf" file (in the same directory where your executable) is with following contents:
    [Paths]
    Plugins = plugins

  3. #3
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    Quote Originally Posted by jacek View Post
    Try creating a "qt.conf" file (in the same directory where your executable) is with following contents:
    This did not fix the problem. I believe this file is used for loading of QtPlugins (ie. plugins that are built into QT). Either way that doesn't seem to be the problem.

    Thanks for the reply. Much appreciated.

    I'm going to try to install the dotNet framework and see if this fixes the problem at least. It'd be at least better than not knowing what is missing on a system for this to not work. I don't get why SP1 and SP2 seem to fix the problem. And how can i distribute this app.

  4. #4
    Join Date
    Aug 2006
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    I had the same problem on Windows when using the qsqlite.dll sqldrivers plugin. I was able to resolve the issue by using the following qt.conf:

    [Paths]
    Prefix = ./
    Plugins = plugins

    Also the folder structure was:

    ExeDirectory\
    ExeDirectory\plugins
    ExeDirectory\plugins\sqldrivers

    qsqlite.dll was located at:
    ExeDirectory\plugins\sqldrivers\qsqlite.dll

    qt.conf was located at:
    ExeDirectory\qt.conf

    Figured I would throw my two cents in.

  5. #5
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    I tried adding the prefix line but still no luck.

    Thanks again for the reply.

  6. #6
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    I tried out plugandpaint example and everything works fine.
    Did you output some debug messages in MainWindow::loadPlugins() (don't forget CONFIG +=console)?
    Do you use VS2005 -> did you also copy the .manifest files?
    Take a look into the registry (regedit) under HKCU\Software\Trolltech\Qt Plugin Cache 4.2\ (or Qt Plugin Cache 4.2.debug for debug) to see if your plugins are found and if they've the correct build key.

    The plugandpaint example loads the plugins manually so it should be easy to see if they're found by modifiyng MainWindow::loadPlugins().

  7. #7
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    Yes, i am using vc2005.

    I am also manually loading plugins from my Main app. I don't believe this is the same problem.

    Thanks for the reply though.

  8. #8
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    So why don't you try out to debug it as I mentioned?

  9. #9
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    Quote Originally Posted by ChristianEhrlicher View Post
    So why don't you try out to debug it as I mentioned?
    i already did with my own app.. i know they are being found because with the same directory structure on another machine they work.

  10. #10
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    So the only problem I can think of is a problem with the manifests / side by side assemblies. The goal was to simplify the dll hell with those crap, but ...
    Try to load the dll with QLibrary and see if it works - when it works, the manifest shouldn't be the problem.

  11. #11
    Join Date
    Jan 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Plugins in Windows [XP]

    Quote Originally Posted by ChristianEhrlicher View Post
    So the only problem I can think of is a problem with the manifests / side by side assemblies. The goal was to simplify the dll hell with those crap, but ...
    Try to load the dll with QLibrary and see if it works - when it works, the manifest shouldn't be the problem.
    Well, i've debugged the problem and here it is;

    in vs2005, it automatically embeds the manifest into the .dll / .exe file. For some reason if you do embed the manifest into a plugin dll, it will NOT load. I don't know why but that is the problem. I recompiled all my plugins without the manifest and they run fine. I'm going to attempt to use the command line tools to embed the manifest and see if there is the same problem just for my own curiosity. Thanks for all your replies. Thanks cmake! Really i love it but damn, what a bug.


    /edit: also, if you embed the manifest into the plugin dll using mt.exe (rather than letting VS2005 do it for you, it does not cause a problem!) What the heck MS...
    Last edited by dcurtis; 9th February 2007 at 03:17.

Similar Threads

  1. transporting qt application fron linux to windows
    By deekayt in forum Qt Programming
    Replies: 4
    Last Post: 20th October 2006, 22:56
  2. Porting Qt application on windows from linux
    By safknw in forum Qt Programming
    Replies: 13
    Last Post: 22nd May 2006, 13:11
  3. Replies: 10
    Last Post: 28th April 2006, 15:48
  4. Application plugin on windows
    By Eyee in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2006, 17:36
  5. Plugins as small application
    By blackliteon in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 09:39

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.