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. Which DLL files to need to run exe files in other computer?
Forum Updated to NodeBB v4.3 + New Features

Which DLL files to need to run exe files in other computer?

Scheduled Pinned Locked Moved General and Desktop
42 Posts 8 Posters 37.6k Views 1 Watching
  • 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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #33

    Hi Jech,

    Did you deploy the built-in QML-related files? You need the *.qml, qmldir and *.dll files in C:<Qt>\qml.

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jech
      wrote on last edited by
      #34

      Yes, I did. I even tried to specify the path to these files either as absolute or relative but it didn't help. It used to work without any problems with Qt4, so I'm wondering why it is a problem with Qt5 now.

      Is there any possibility to debug the problem to at least find out if the problem is related to QML files or something else?

      Thank you!

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jech
        wrote on last edited by
        #35

        Hi JKSH,
        just to be sure, you mean the 3 files in directory c:\Qt\5.2.0\mingw48_32\qml\QtQml\Models.2 ? I suppose they should be in the same directory as my .exe file. Or somewhere else?

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #36

          Hi Jech,

          I mean _C:\Qt\5.2.0\mingw48_32\qml_ itself.

          These are your plugins folders:

          • C:\Qt\5.2.0\mingw48_32\plugins\ -- C++ plugins
          • C:\Qt\5.2.0\mingw48_32\qml\ -- QML plugins

          You need to copy some of the subfolders in these plugin folders. The exact combination that you need depends on the features that you use. Example:

          • <MyApp>\app.exe
          • <MyApp>\ qml\MyApp\main.qml ^
          • <MyApp>\ qml\MyApp\MyCustomQmlFile.qml ^
          • <MyApp>\Qt5Core.dll
          • ...
          • <MyApp>\QtQuick.2\qmldir
          • <MyApp>\QtQuick.2\qtquick2plugin.dll
          • <MyApp>\platforms\qwindows.dll

          The first 3 (italicized) lines are your project-specific files, which you should copy from your build directory. The rest should be copied from _C:\Qt\5.2.0\mingw48_32_ somewhere.

          The 2nd and 3rd (^) lines depend on your code. My example above assumes that you used Qt Creator's defaults for a new Qt Quick 2 project, so your main.cpp should have this line:
          @
          // Your deployment folder structure is shown below:
          viewer.setMainQmlFile(QStringLiteral("qml/MyApp/main.qml"));
          @

          An easy way is to copy all the subfolders of _c:\Qt\5.2.0\mingw48_32\qml_ into your .exe directory, and then launch your program. If it works, delete things one by one and try launching again, to see what you need and what you don't.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jech
            wrote on last edited by
            #37

            This is really strange. I copied everything from *C:\Qt\5.2.0\mingw48_32\plugins* and *C:\Qt\5.2.0\mingw48_32\qml* to the directory with my .exe file. The other .dll and .qml files are in their place too. But the result is still the same, I only get a blank window without any content and no error message is displayed.

            If I compile my program using Qt4, it is very easy to deploy it and I don't have any problems with it.

            Do you have any idea what I could try? For example is there a way I could get any debug information from the application. I have no idea what could be wrong. :-(

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #38

              Maybe try deploying a Hello World QML app first, to figure out what you need. Once you succeed, then try deploying your complex app.

              [quote author="jech" date="1389000430"]I copied all the DLLs the program requested, but if I run it, I only get a blank window.[/quote]I just noticed this part. You'll need some DLLs that the program DOESN'T ask for too; you won't get popup messages for DLLs that are loaded dynamically AFTER the program starts running.

              See http://qt-project.org/doc/qt-5/windows-deployment.html -- use Dependency Walker to open your application.

              Note: You will get some false positives. Ignore the warnings about API-MS-WIN*.DLL, DCOMP.DLL and IESHIMS.DLL.

              Then, click "Profile" -> "Start Profiling...". This will reveal the dynamically-loaded DLLs.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jech
                wrote on last edited by
                #39

                Thanks a lot for your help and suggestions. I finally found out what I was missing. I simply copied all release **.dll files from from _c:\Qt\5.2.0\mingw48_32\bin_ and then by deleting them I only left those, which were necessary for my app to run. The 2 files I was missing were Qt5Multimedia.dll and Qt5MultimediaQuick_p.dll. I'm surprised I don't need any files from the ..\plugins and ..\qml directories.

                I tried to use Dependency Walker but I was not able to find out any useful information from the log. But it seems to be a very useful tool once I understand it. :-)

                Thanks a lot for your help.

                1 Reply Last reply
                0
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #40

                  You're welcome :)

                  One last thing to try, do be safe: Rename your Qt SDK folder and launch your app again. Qt DLLs remember the absolute path where they came from, so your app might load some DLLs from your SDK folder instead of your deployment folder.

                  Once you've finished testing this, rename your Qt SDK folder back.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DavidGGG
                    wrote on last edited by
                    #41

                    Don't know why Dependency Walker didn't work. I use a similar tool, Process Explorer from Microsoft, and just put all listed DLLs in the same folder as the exe

                    http://technet.microsoft.com/sv-se/sysinternals/bb896653.aspx

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #42

                      DavIdGGG, welcome to devnet

                      If you are using Qt 5 you need also to pay attention to the "Qt plugins":http://qt-project.org/doc/qt-5/windows-deployment.html#qt-plugins, which are not discovered by Dependency Walker.

                      Vote the answer(s) that helped you to solve your issue(s)

                      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