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. How to include QtGui4.dll into app
Forum Update on Tuesday, May 27th 2025

How to include QtGui4.dll into app

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.3k 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.
  • S Offline
    S Offline
    saobien39
    wrote on last edited by
    #1

    Well, when I build 1 project, It will publish a folder desktop. Follow some instructions on internet. I copied file QtGui4.dll from path E:\Programs\QtSDK\QtCreator\bin to path C:\Windows\System32. It's pity, It didn't run.

    !http://nn8.upanh.com/b6.s29.d3/796464d0d5d4298bec675fcd85db715c_45757728.h1.png(Image)!

    Seems app can't "see" file QtGui4.dll...

    ps: when I send app to client, I can't write guide document and require them must do anything (of course they can't know what PATH is). Having another way to solve ...

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      The dlls you copied is wrong.

      You should copy the dlls which are provided by the Qt Library instead of Qt Creator.


      BTY, you never need to copy the dll to system directory, add the QTDIR/bin to your system environment variable will works.

      If you are deploy your application, don't forget the plugins needed by your application.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        Be also aware that you are obviously publishing a debug version of your application (QtGui d 4.dll), not a release version (which requires QtGui4.dll).

        When running your application on the development machine and outside of QtCreator it is sufficient to add $QTDIR/bin to your path (where $QTDIR points to your Qt installation); when released, you will have to distribute the DLLs along with your application and place it in one of the following locations:

        • The directory where the executable module for the current process is located
        • The current directory
        • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory (usuall C:\Windows\System32)
        • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory (usually C:\Windows)
        • The directories listed in the PATH environment variable

        See also "Deploying an Application on Windows":http://qt-project.org/doc/qt-4.8/deployment-windows.html.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          saobien39
          wrote on last edited by
          #4

          Thanks, I still have a little problem. I add following url into environment variable.

          !http://nn4.upanh.com/b2.s26.d2/ece9b9f20f1ecd13fdd9cd9e8683e104_45768014.h1.png!

          Run app again, it display above error. Lukas's right, first I need run a debug version. Really I can't see QtGui d 4.dll in url which I added into environment variable (only QtGui4.dll)

          @Lukas: You wrote "one of the following locations" or "all of the following locations", having difference? which way did you choose to distribute release version?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            You either build a debug version of your application or you build a release version of your application (you can switch between them in the lower left corner in QtCreator, right above the 'Run' button). A debug version of your application is used during development, as it contains additional code and information which allow for better error tracking. When deploying an application, you should always use a release version, as this additional information is of no use to the user, slows down and enlarges your applcation and possibly exposes internal implementation details.

            A debug version of your application needs a debug version of the Qt libraries (having a d in their name, for example QtGuid4.dll) and a release version of your application needs a release version of the Qt libraries (having no d in their name, for example QtGui4.dll).

            In addition of beeing tied to the application version, libraries are also tied to toolchain used to build the application. If you build your application using MSVC2008, you will have to use libraries beeing built with MSVC20008 as well, if you build your application using MSVC2010, you will have to use libraries beeing built MSVC2010, and so on.

            These libraries can be found in the corresponding Qt installation directory, which is usually <where you have installed the SDK>/Desktop/<version>/<toolchain>.

            So if you build a debug version of your application using MSVC2010 and Qt 4.8.2 you will have to pick the *d4.dll libraries from E:\Programs\QtSDK\Desktop\4.8.2\MSVC2010 (or similiar, I have no Qt SDK installation at hand) and place it in one of the locations I've posted - usually the directory containing the .exe file.

            Make sure you've read the article I've linked.

            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