PDA

View Full Version : error when running the "release" executable



Ferric
20th January 2010, 22:32
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

john_god
21st January 2010, 01:01
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)

squidge
21st January 2010, 07:28
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.

Ferric
21st January 2010, 23:58
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

ChrisW67
22nd January 2010, 00:56
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.

john_god
30th January 2010, 19:26
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