Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10)
-
Then you did not deploy the application hence the error. That's a classic.
-
Hi all,
@SGaist: Thank you for providing the link. Interesting material, that is.
As suggested by @SGaist: running windeployqt.exe does update the dll's which are 'missing'. This results in some 10+ dll-files added to the "working" directory (in which the .exe is situated).
Running windeployqt:
What I get, is that by building the project, some dependencies are omittted, if you like. A couple of questions:
- Would this be in some way fixable, meaning that it will be done automatically through building the project?
- Is this the way forward, for ALL projects which have GUIs/widgets / Qt-coding?
- Is this "updating dll's" the same as applying the OpenSSL libraries, or are these a completely different thing?m(not so familiar with dependencies, yet ;] )
Update: after fixing the dll dependencies as stated above, I do NOT get the error message, however, nothing at all happens.
/Paul
-
Looks like you are implementing a QtQuick application, if so, you should use the -qml option so that your files can be scanned and deployed if needed. That will also deploy their dependencies.
-
Hi,
I stopped for some days, and when trying some <other> projects it,once again, fired the same error (the 000007b).
Where should I do the -qml? In the qmake? Or in the mingw32-make.exe ? Or in the windeployqt?And, what is the reason I have to call it? Why isn't it automatically called, if needed?
Regarding this other project: I tried to use the Qt-environment within Visual Studio 2019, building the simple project (simply projecting a rectangle) resulted in 1 "succeeded", but double-click Tutorial1.exe results in 000007b. Also after windeployqt.
-
@mrinsane said in Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10):
Hi,
I stopped for some days, and when trying some <other> projects it,once again, fired the same error (the 000007b).
Where should I do the -qml? In the qmake? Or in the mingw32-make.exe ? Or in the windeployqt?And, what is the reason I have to call it? Why isn't it automatically called, if needed?
Regarding this other project: I tried to use the Qt-environment within Visual Studio 2019, building the simple project (simply projecting a rectangle) resulted in 1 "succeeded", but double-click Tutorial1.exe results in 000007b. Also after windeployqt.
Wow... even my simple "helloQT" test, which was working (only after the windeployqt was performed) is now also resulting in 000007b. (It does quite seem that Qt is buggy /or I should say 'supersensitive', which means it almost is impossible to work with.....It cannot be that some exe suddenly does not want to run, can it?
-
It's an argument of windeployqt.
You can't always automate everything. The tool helps you creating a deployable application but you have to feed it some information.
-
Ok, that's it. Qt is schizophrenic by itself. :-( :-(
I "fixed' the Hello Qt test. Somewhat.
I will explain all I did:- Windows 10, 64-bit.
- hello tutorial, which pops-up a widget, with the text "HelloQt!"
- Qt Creator 4.13.1 (as part of Qt 5.15.1 (MSVC 2019, 32bit)). [actually, the Qt install in C:\ says 5.12.0 ]
- code hello.pro:
###################################################################### # Automatically generated by qmake (3.1) Tue Mar 30 00:57:06 2021 ###################################################################### TEMPLATE = app TARGET = hello INCLUDEPATH += . # The following define makes your compiler warn you if you use any # feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 # Input SOURCES += hello.cpp QT += widgets
- code hello.cpp:
#include <QApplication> #include <QLabel> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("<h2><i>Hello</i> " "<font color=green>Qt!</font></h2>");; label->show(); //QPushButton *button = new QPushButton("Quit"); //QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit())); //button->show(); return app.exec(); }
- I open the project by doubleclick hello.pro -it opens in QtCreator
- I get presented a dialogue for configuring the project: I choose Qt 5.12.10 MinGW 64-bit
- I click BUILD, and the build-folders (debug, release) are created, no errors whatsoever in QtCreator.
- If I click RUN, the following happens:
- In Application Output, the following is stated:
- When I navigate (CMD) to the location of the exe (\build-hello-debug\debug), I doubleclick:
- Performing the windeploy (C:\Qt\Qt5.12.10\5.12.10\mingw73_32\bin\windeployqt.exe -qml .)
- Same error, it does not want to run.
So, as a summary: Qt processes the code, the appropriate folders/files aregenerated. It even is capable of DOING what it should do (i.e., show the window with some text), but the application itself (*.exe) does not want to do it.
I'm going crazy.
-
@mrinsane said in Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10):
- I get presented a dialogue for configuring the project: I choose Qt 5.12.10 MinGW 64-bit
... - Performing the windeploy (C:\Qt\Qt5.12.10\5.12.10\mingw73_32\bin\windeployqt.exe -qml .)
You can't mix 32-bit and 64-bit binaries.
Delete the 64-bit .exe and the 32-bit DLLs from that folder. Then, try again using C:\Qt\Qt5.12.10\5.12.10\mingw73_64\bin\windeployqt.exe.
Note: You don't need
-qml
when deploying your Hello app, since you're not using QML here - I get presented a dialogue for configuring the project: I choose Qt 5.12.10 MinGW 64-bit
-