Results 1 to 6 of 6

Thread: error when running the "release" executable

  1. #1
    Join Date
    Dec 2009
    Location
    New Zealand
    Posts
    54
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default error when running the "release" executable

    Hi,

    Using Qt Creator, my program works fine when I set the build configuration to debug. When I set the build configuration to release mode, it also works fine, but then when I try to run my program from the .exe file in the "release" folder, I get the following error message:

    This application has failed to start because QtCored4.dll was not found. Re-installing the application may fix this problem.
    (as shown in attachment)

    Presently I would like to make it so that any windows machine only needs to run a single executable file in order for my program to work..


    Thanks
    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    287
    Thanks
    23
    Thanked 31 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: error when running the "release" executable

    You have to add your Qt bin ddirectory to the windows path (assuming you're using windows and have done the default installation it will be C:\Qt\2009.05\qt\bin).

    Other solution, for deploying your application on another machine, it will be to copy the necessary dll's to the same file.exe directory (typically with will be qtcore4.dll, qtgui4.dll, anf if you using mingw, mingwm10.dll and libgcc_s_dw2-1.dll)
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error when running the "release" executable

    Quote Originally Posted by Ferric View Post
    Using Qt Creator, my program works fine when I set the build configuration to debug. When I set the build configuration to release mode, it also works fine, but then when I try to run my program from the .exe file in the "release" folder, I get the following error message:
    Either you are mistaken or you have a configuration error as Qtcored4.dll is the debug version of the Qt libraries. For release mode you should be linking against Qtcore4.dll.

    To get your application working on another PC, you need to copy the QtCore4.dll and any other libraries you need (eg. QtGUI4.dll) into the system path or your programs working directory.

  4. #4
    Join Date
    Dec 2009
    Location
    New Zealand
    Posts
    54
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error when running the "release" executable

    You have to add your Qt bin ddirectory to the windows path (assuming you're using windows and have done the default installation it will be C:\Qt\2009.05\qt\bin).
    yes, I am using windows XP and I did the default installation. How do I add the Qt bin directory to the windows path?

    Thanks

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,688
    Thanks
    13
    Thanked 1,598 Times in 1,526 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error when running the "release" executable

    Quote Originally Posted by Ferric View Post
    Hi,
    Presently I would like to make it so that any windows machine only needs to run a single executable file in order for my program to work..
    To completely avoid the need to ship runtime DLLs with your application you will need to statically link Qt into it. There are licensing implications when you distribute the resulting executable.

    If the "single executable file" can be a self-installer then you can bundle the relevant runtime libraries with your application inside the installer.

  6. #6
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    287
    Thanks
    23
    Thanked 31 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: error when running the "release" executable

    Quote Originally Posted by Ferric View Post
    yes, I am using windows XP and I did the default installation. How do I add the Qt bin directory to the windows path?

    Thanks
    http://www.computerhope.com/issues/ch000549.htm
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

Similar Threads

  1. Replies: 3
    Last Post: 29th August 2009, 23:24
  2. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 12:45
  3. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  4. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58
  5. Did you people get the unsolicited mail? - "Release of Makedoc"
    By jamadagni in forum General Discussion
    Replies: 5
    Last Post: 14th February 2006, 13:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.