Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:18:38+00:00 2026-05-27T07:18:38+00:00

I have a simple project created in Qt Creator (installed using Qt SDK 1.1.4).

  • 0

I have a simple project created in Qt Creator (installed using Qt SDK 1.1.4). It runs just fine from within Qt Creator, but if I then browse to the output directory in Windows and double-click the EXE, I’ll get an error like:

The program can't start because QtCored4.dll is missing from your computer.
Try reinstalling the program to fix this problem.

That’s obviously because Qt isn’t in my PATH (and I don’t want it to be, in case I have multiple versions of Qt on my computer), and Qt Creator / qmake didn’t copy the Qt DLLs to the project output.

What I would like to do is use qmake to copy the necessary Qt files to the project output directory – wherever it may be. How do I do this?

(I tried creating a custom target in qmake, but I’m not getting too far…)

UPDATE July 19, 2016: Just to clarify, the above post was concerning Qt4. On Qt5, you should instead look into calling windeployqt. This Qt5 tool will read your binary, determine which Qt5 runtime files you need, and copy them to your binary directory. Also note that it will fix absolute paths in the Qt5::Core library that are specific to your PC – so use of this tool is basically mandatory unless you want to provide a qt.conf file yourself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:18:38+00:00Added an answer on May 27, 2026 at 7:18 am

    OK, here’s an ugly hack:

    # Copy required DLLs to output directory
    CONFIG(debug, debug|release) {
        QtCored4.commands = copy /Y %QTDIR%\\bin\\QtCored4.dll debug
        QtCored4.target = debug/QtCored4.dll
        QtGuid4.commands = copy /Y %QTDIR%\\bin\\QtGuid4.dll debug
        QtGuid4.target = debug/QtGuid4.dll
    
        QMAKE_EXTRA_TARGETS += QtCored4 QtGuid4
        PRE_TARGETDEPS += debug/QtCored4.dll debug/QtGuid4.dll
    } else:CONFIG(release, debug|release) {
        QtCore4.commands = copy /Y %QTDIR%\\bin\\QtCore4.dll release
        QtCore4.target = release/QtCore4.dll
        QtGui4.commands = copy /Y %QTDIR%\\bin\\QtGui4.dll release
        QtGui4.target = release/QtGui4.dll
    
        QMAKE_EXTRA_TARGETS += QtCore4 QtGui4
        PRE_TARGETDEPS += release/QtCore4.dll release/QtGui4.dll
    } else {
        error(Unknown set of dependencies.)
    }
    

    Here’s some of what I don’t like about it:

    • Uses %QTDIR% environment variable; this variable isn’t evaluated until the copy command is actually run. Seems like something along the lines of QMAKE_LIBS_QT_DLL would be more appropriate, but I couldn’t get that working for some reason.
    • Hard-coded “debug” and “release” names; seems like there ought to be some kind of variable to use for that.
    • Calling out to the environment by using the “copy” command.

    I’ll accept another answer if somebody can clean this up a good bit, for example by shortening it and/or addressing some of my concerns, or just finding a better way in general.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created simple project from maven-achetype-quickstart under Eclipse Indigo, then I went to
I have created simple project from maven-archetype-quickstart under Eclipse Indigo, then I went to
I am using Eclipse with WindowsBuilder. I have created a small simple project to
I have created simple HelloWorld project from Spring MVC template in Spring STS. I
i have created a simple public ref class in the vc++ project, which is
We have a simple project where we read data from a socket and we
I have a simple Scala project that runs without any problems inside Eclipse, however,
I have this simple test project just to test the IncludeExceptionDetailInFaults behavior. public class
I have created a simple project where everyone can create one or more Blog.
I have created windows service project in vs2008. I have created simple serivce project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.