Problem in deploying stand-alone executable binary
-
Hi all,
I got a problem in deploying Qt application. I created a default Qt Widgets application with Qt 5.4.1 (MSVC2010, 32 bit) then built and ran it successfully on my PC.
After that, I need to deploy my application to other PCs which do not have Qt installed: a Window 7 and a Window 10 PC. I created a new folder contains my application binary and all *.dll files needed such as Qt5Core.dll, Qt5Guid.dll, Qt5Widgets.dll. OK, everything seems fine, my application can run independently on my PC.
I shared above folder to 2 mentioned PCs to check if I can deploy my app. The problem appears as below:-
Qt Widgets application with DEBUG mode => the deployed PC cannot run the binary with error MSVCR120d.dll is missing. I downloaded that library in the internet and install it to C:/Windows/SysWOW64. The missing file problem was solved but another came. The application is crashed at the time be executed with error
The application was unable to start correctly (0xc000007b). Click OK to close the application.
-
Qt Widgets application with RELEASE mode: It seems OK. No need to install other libraries and the application can run successfully.
-
Qt Widgets application with RELEASE mode + using QDomDocument: My application required *.xml parsing/creating. So I add QT += xml to my *.pro file and try to use QDomDocument with a simple line of code
QDomDocument doc;
Unfortunately, this causes a crash in the non-Qt PC with errorThe application was unable to start correctly (0xc000007b). Click OK to close the application.
Please help me a way to deploy my application.
Thank you very much.
-
-
@tanmanh0707
The initial answer to this kind of question is: why are you not using windeployqt (http://doc.qt.io/qt-5/windows-deployment.html) for deployment? -
Hi
And also besides using the tool as @JonB says.
Read this also.
http://www.tripleboot.org/?p=138The app needs a deployment folder. with right structured and the needed DLLS. The DLLS are different from debug to release so dont mix.
The debug verson has a d in name Qt5Guid.dll.Both mingw and visual stud compiler might need its runtime files if say win 7. Sometimes it can be found in system.