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] Program EXE runs in Qt Creator but can't find DLLs when run outside of Qt Creator
Forum Update on Monday, May 27th 2025

[SOLVED] Program EXE runs in Qt Creator but can't find DLLs when run outside of Qt Creator

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 22.4k 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.
  • S Offline
    S Offline
    SteveG
    wrote on 28 May 2014, 18:55 last edited by
    #1

    I created a simple app for testing consisting of a test.pro file, a test.qrc file, main.cpp and main.qml. When I build and run this on Windows 8 64 bit using Qt 5.3.0, Qt Creator and MinGW 32 bit, it creates a Test.exe file and runs it. However, when I try to run Test.exe outside of Qt Creator it complains that "The program can't start because Qt5Core.dll is missing from your computer. Try reinstalling the program to fix this program." main.o, qrc_test.cpp and qrc_test.o are also in the build's release directory created by Qt Creator.

    Looking at some of the posts it seems like one way to resolve this is to copy the missing DLLs to where Test.exe resides. This requires identifying all the DLLs and then copying them. I tried to copy Qt5Core.dll from the 5.3/mingw482_32/bin directory into plugins/platforms as suggested but it didn't work. I then copied it to platforms, also as suggested, but it didn't work. I then copied it into the same directory as Test.exe and then had an error for Qt5Gui.dll. I assume it will complain until I copy all of the required DLLs. I examined Test.exe and it does contain a list of DLLs. Is this an internal manifest?

    Is there any way to get Test.exe to run without copying the required DLLs? How does Qt Creator successfully run Test.exe?

    Thanks.

    1 Reply Last reply
    1
    • A Offline
      A Offline
      andreyc
      wrote on 28 May 2014, 19:23 last edited by
      #2

      You can add the directories where Qt libraries reside to the system PATH

      [quote]How does Qt Creator successfully run Test.exe?[/quote]
      QtCreator modifies the environment to make all Qt libraries available before starting an application.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 28 May 2014, 19:24 last edited by
        #3

        Hi,

        Qt Creator modifies the PATH environment variable to ensure your software finds the right Qt version.

        Did you already had a look at this very good wiki "entry":http://qt-project.org/wiki/Deploy_an_Application_on_Windows ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • S Offline
          S Offline
          SteveG
          wrote on 28 May 2014, 20:16 last edited by
          #4

          I wasn't aware of the article but will look at it. I created a simple batch file runTest.bat with the following and it works.
          @
          set PATH=C:\Qt\Qt5.3.0\5.3\mingw482_32\bin;%PATH%
          Test.exe
          @

          Thank you both.

          1 Reply Last reply
          1

          1/4

          28 May 2014, 18:55

          • Login

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