Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Why my Qt app does not find Qt plugins?

[SOLVED] Why my Qt app does not find Qt plugins?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 6.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    viktor.benei
    wrote on last edited by
    #1

    We're working on a cross-platform (win-mac) app. It works on development machines. But somehow it cannot find the required Qt plugins (sqlite driver for example) on other machines. I tried on 2 virtual machines (XP SP2 and XP SP3) and on 1 real one (XP SP3), none of them found the plugins. The app starts and works, it simply does not find the required plugins, only on development machines - I checked, and even on dev machines it loads the plugins from QtSDK folders, not from the folders containing exe. The Qt DLLs are loaded from the folder of the exe.

    I even added a plugins/ folder manually:
    @QCoreApplication::addLibraryPath(PathManager::getClientPluginsDirectory());@

    And I print all the pathes Qt will search in ( QCoreApplication::libraryPaths(); ), and it prints both the appDir (contains the exe) and appDir/plugins (contains the plugins directories), but it just can't find them.

    I use Qt 4.7.3 and MSVC 2008.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi viktor,

      I assume you mean the sqlite plug-in of Qt, right?
      it should be located in a sub dir of the executable named sqldrivers, so if your exe is under
      C:\myPath, then the plugin should be in C:\myPath\sqldrivers

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        viktor.benei
        wrote on last edited by
        #3

        And it's there. Actually I copied the whole plugins/ folder from QtSDK's msvc2008 folder next to the exe. I also tried to put the folders in QtSDK's plugins/ folder directly next to the exe, as well to a plugins/ folder, but no luck so far.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          The build version of the plugins, your Qt lib and your executable need to match exactly: same Qt version, same compilation flags, all in release or all in debug mode, etc.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            viktor.benei
            wrote on last edited by
            #5

            I double checked them. Also as I wrote on my development machine (Win7) the app works, but when I checked the runtime dll dependencies with SysinternalSuite's procexp is shows that it loads the plugins from the QtSDK msvc2008/plugins folder (even if I don't start the app from QtCreator!). I copied exactly the same dlls, but it just can't find them somehow...

            1 Reply Last reply
            0
            • V Offline
              V Offline
              viktor.benei
              wrote on last edited by
              #6

              Could it happen because some MSVC redistributable dlls missing from the test machines? I copied all I found with SysinternalSuite's procexp, and the application starts and works, but is it possible that a Qt plugin cannot be loaded because it would require further MSVC redist dlls?

              I just tried everything I could think about, but nothing works.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                That is certainly possible. You can check that with a dependency walker.

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  viktor.benei
                  wrote on last edited by
                  #8

                  I checked it with Dep.Walker, and I can't see any missing MSVC redist dlls. It uses:

                  msvcr90.dll and msvcp90.dll

                  I don't see any further MSVC redist dlls. (Both of these dlls are copied with the exe)

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    viktor.benei
                    wrote on last edited by
                    #9

                    Ahh, I can't believe it... The qsqlite4.dll requires msvcr90.dll, which is next to the exe. But when it tries to load the dll I suppose it changes the working-directory to qsqlite4.dll 's folder, which does not contains msvcr90.dll.

                    If I copy msvcr90.dll next to qsqlite4.dll it can find it and the app can load the sqlite plugin. If only the exe directory contains msvcr90.dll then it can not...

                    Is this a common problem? Are there any solution no to have multiple msvcr90.dll s in every plugin folder?

                    This is important, because the app does not require any installation, and I don't want to install MSVC redistributable installer.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved