Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10)
QtWS25 Last Chance

Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10)

Scheduled Pinned Locked Moved Solved General and Desktop
qmakemakecommand linebuilding errorwindows 10
19 Posts 6 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS SGaist

    Did you double-click on the executable file ?

    M Offline
    M Offline
    mrinsane
    wrote on last edited by
    #10

    @SGaist said in Unable to build simple hello-tutorial (Windows 10, command line, Qt5.12.10):

    Did you double-click on the executable file ?

    Yes, simple double click, as one would do when opening a program or app.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #11

      Then you did not deploy the application hence the error. That's a classic.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mrinsane
        wrote on last edited by
        #12

        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:
        Command Prompt - 29 Mar 2021 , 23_44_16.png

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #13

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • M Offline
            M Offline
            mrinsane
            wrote on last edited by mrinsane
            #14

            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.

            M 1 Reply Last reply
            0
            • M mrinsane

              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.

              M Offline
              M Offline
              mrinsane
              wrote on last edited by
              #15

              @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?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #16

                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.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mrinsane
                  wrote on last edited by
                  #17

                  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 hello - Qt Creator - 4 Apr 2021 , 14_27_05.png
                  • I click BUILD, and the build-folders (debug, release) are created, no errors whatsoever in QtCreator.
                  • If I click  RUN, the following happens:hello - Qt Creator - 4 Apr 2021 , 14_31_42.png
                  • In Application Output, the following is stated:hello - Qt Creator - 4 Apr 2021 , 14_36_48.png
                  • When I navigate (CMD) to the location of the exe (\build-hello-debug\debug), I doubleclick:hello.exe - Application Error - 4 Apr 2021 , 14_38_19.png
                  • 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.

                  JKSHJ 1 Reply Last reply
                  0
                  • M mrinsane

                    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 hello - Qt Creator - 4 Apr 2021 , 14_27_05.png
                    • I click BUILD, and the build-folders (debug, release) are created, no errors whatsoever in QtCreator.
                    • If I click  RUN, the following happens:hello - Qt Creator - 4 Apr 2021 , 14_31_42.png
                    • In Application Output, the following is stated:hello - Qt Creator - 4 Apr 2021 , 14_36_48.png
                    • When I navigate (CMD) to the location of the exe (\build-hello-debug\debug), I doubleclick:hello.exe - Application Error - 4 Apr 2021 , 14_38_19.png
                    • 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.

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by JKSH
                    #18

                    @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

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    1
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #19

                      Adding to @JKSH, the qml option expects the path to the files in your project sources so it can parse them to pull all the required dependencies.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • M mrinsane has marked this topic as solved on

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved