Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator cannot build main.qml file, an example qml from a book!
Forum Updated to NodeBB v4.3 + New Features

QtCreator cannot build main.qml file, an example qml from a book!

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qtcreator12
17 Posts 4 Posters 1.6k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    jdent
    wrote on 9 Mar 2024, 17:55 last edited by
    #1

    U:\Users\Juan Dent\Qt\with QtCreator\build-QtQuickApp-Desktop_Qt_6_6_2_MSVC2019_64bit-Debug_deps\ds-build\src\imports\tools\eventsimulator\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp:-1: error: C1083: Cannot open compiler generated file: '': Invalid argument
    :-1: error: ninja: build stopped: subcommand failed.

    What is wrong?

    A 1 Reply Last reply 10 Mar 2024, 07:57
    0
    • J jdent
      9 Mar 2024, 17:55

      U:\Users\Juan Dent\Qt\with QtCreator\build-QtQuickApp-Desktop_Qt_6_6_2_MSVC2019_64bit-Debug_deps\ds-build\src\imports\tools\eventsimulator\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp:-1: error: C1083: Cannot open compiler generated file: '': Invalid argument
      :-1: error: ninja: build stopped: subcommand failed.

      What is wrong?

      A Online
      A Online
      Axel Spoerl
      Moderators
      wrote on 10 Mar 2024, 07:57 last edited by
      #2

      What is wrong?

      Please show the main.qml file here. Without some more information, it's hard to say. Could be anything from a broken compile kit, wrong Qt version, broken example from the book.

      Software Engineer
      The Qt Company, Oslo

      J 1 Reply Last reply 10 Mar 2024, 12:27
      0
      • A Axel Spoerl
        10 Mar 2024, 07:57

        What is wrong?

        Please show the main.qml file here. Without some more information, it's hard to say. Could be anything from a broken compile kit, wrong Qt version, broken example from the book.

        J Offline
        J Offline
        jdent
        wrote on 10 Mar 2024, 12:27 last edited by
        #3
        This post is deleted!
        J 1 Reply Last reply 10 Mar 2024, 12:29
        0
        • J jdent
          10 Mar 2024, 12:27

          This post is deleted!

          J Offline
          J Offline
          jdent
          wrote on 10 Mar 2024, 12:29 last edited by
          #4

          @jdent the main.qml is

          /* This file is generated and only relevant for integrating the project into a Qt 6 and cmake based
          C++ project. */
          import QtQuick
          import QtQuick.Controls
          
          ApplicationWindow {
              visible: true
              width: 640
              height: 480
              title: qsTr("Hello QML")
          
              menuBar: MenuBar {
                  Menu {
                      title: qsTr("File")
                      MenuItem {
                          text: qsTr("Exit")
                          shortCut: "Ctrl+Q"
                          onTriggered: Qt.quit()
                      }
                  }
              }
          
              Text {
                  id: hw
                  text: qsTr("Hello World")
                  font.capitalization: Font.AllUppercase
                  anchors.centerIn: parent
              }
          
              Label {
                  anchors { bottom: hw.top; bottomMargin: 5; horizontalCenter: hw.horizontalCenter }
                  text: qsTr("Hello Qt Quick")
              }
          }
          

          And the kit I believe its broken

          J 2 Replies Last reply 10 Mar 2024, 12:38
          0
          • J jdent
            10 Mar 2024, 12:29

            @jdent the main.qml is

            /* This file is generated and only relevant for integrating the project into a Qt 6 and cmake based
            C++ project. */
            import QtQuick
            import QtQuick.Controls
            
            ApplicationWindow {
                visible: true
                width: 640
                height: 480
                title: qsTr("Hello QML")
            
                menuBar: MenuBar {
                    Menu {
                        title: qsTr("File")
                        MenuItem {
                            text: qsTr("Exit")
                            shortCut: "Ctrl+Q"
                            onTriggered: Qt.quit()
                        }
                    }
                }
            
                Text {
                    id: hw
                    text: qsTr("Hello World")
                    font.capitalization: Font.AllUppercase
                    anchors.centerIn: parent
                }
            
                Label {
                    anchors { bottom: hw.top; bottomMargin: 5; horizontalCenter: hw.horizontalCenter }
                    text: qsTr("Hello Qt Quick")
                }
            }
            

            And the kit I believe its broken

            J Offline
            J Offline
            jdent
            wrote on 10 Mar 2024, 12:38 last edited by jdent 3 Oct 2024, 12:39
            #5

            @jdent The build settings has the CMAKE_GENERATOR as Ninja and it appears as red ; I don't know what it should be??

            1 Reply Last reply
            0
            • J jdent
              10 Mar 2024, 12:29

              @jdent the main.qml is

              /* This file is generated and only relevant for integrating the project into a Qt 6 and cmake based
              C++ project. */
              import QtQuick
              import QtQuick.Controls
              
              ApplicationWindow {
                  visible: true
                  width: 640
                  height: 480
                  title: qsTr("Hello QML")
              
                  menuBar: MenuBar {
                      Menu {
                          title: qsTr("File")
                          MenuItem {
                              text: qsTr("Exit")
                              shortCut: "Ctrl+Q"
                              onTriggered: Qt.quit()
                          }
                      }
                  }
              
                  Text {
                      id: hw
                      text: qsTr("Hello World")
                      font.capitalization: Font.AllUppercase
                      anchors.centerIn: parent
                  }
              
                  Label {
                      anchors { bottom: hw.top; bottomMargin: 5; horizontalCenter: hw.horizontalCenter }
                      text: qsTr("Hello Qt Quick")
                  }
              }
              

              And the kit I believe its broken

              J Offline
              J Offline
              jdent
              wrote on 10 Mar 2024, 13:51 last edited by
              #6

              @jdent I don't know the version of the QtQuick and QtQuick.Controls - I installed 6.6.2. where can I find the version? Could that be the culprit?

              D 1 Reply Last reply 10 Mar 2024, 14:00
              0
              • J jdent
                10 Mar 2024, 13:51

                @jdent I don't know the version of the QtQuick and QtQuick.Controls - I installed 6.6.2. where can I find the version? Could that be the culprit?

                D Offline
                D Offline
                DeepakVishak
                wrote on 10 Mar 2024, 14:00 last edited by
                #7

                @jdent
                Hi Jdnet,

                Did you try to look at general messages tab. If you have no sufficient information on issues tab you can find it on general messages maybe you can find the exact issue over there.

                A 1 Reply Last reply 10 Mar 2024, 14:45
                0
                • D DeepakVishak
                  10 Mar 2024, 14:00

                  @jdent
                  Hi Jdnet,

                  Did you try to look at general messages tab. If you have no sufficient information on issues tab you can find it on general messages maybe you can find the exact issue over there.

                  A Online
                  A Online
                  Axel Spoerl
                  Moderators
                  wrote on 10 Mar 2024, 14:45 last edited by
                  #8

                  @jdent
                  If you believe your kit is broken, there should be a warning / error icon in front of the kit name in Creator. If you hover over this icon, you will get the reason for the error / warning.

                  Software Engineer
                  The Qt Company, Oslo

                  J 1 Reply Last reply 10 Mar 2024, 15:04
                  0
                  • A Axel Spoerl
                    10 Mar 2024, 14:45

                    @jdent
                    If you believe your kit is broken, there should be a warning / error icon in front of the kit name in Creator. If you hover over this icon, you will get the reason for the error / warning.

                    J Offline
                    J Offline
                    jdent
                    wrote on 10 Mar 2024, 15:04 last edited by
                    #9

                    @Axel-Spoerl kits.png

                    I have some kits with warnings but that should not matter because I am using the default Desktop kit correct?

                    A 1 Reply Last reply 10 Mar 2024, 15:08
                    0
                    • J jdent
                      10 Mar 2024, 15:04

                      @Axel-Spoerl kits.png

                      I have some kits with warnings but that should not matter because I am using the default Desktop kit correct?

                      A Online
                      A Online
                      Axel Spoerl
                      Moderators
                      wrote on 10 Mar 2024, 15:08 last edited by
                      #10

                      @jdent The broken ones are your Android kits. But I reckon, you want to compile for Windows?
                      That should work.
                      Please do a fresh configureand ninjafrom the command line.
                      What does it say?

                      Software Engineer
                      The Qt Company, Oslo

                      J 1 Reply Last reply 10 Mar 2024, 15:18
                      0
                      • A Axel Spoerl
                        10 Mar 2024, 15:08

                        @jdent The broken ones are your Android kits. But I reckon, you want to compile for Windows?
                        That should work.
                        Please do a fresh configureand ninjafrom the command line.
                        What does it say?

                        J Offline
                        J Offline
                        jdent
                        wrote on 10 Mar 2024, 15:18 last edited by
                        #11

                        @Axel-Spoerl you mean like this:

                        U:\Qt\Tools\Ninja>ninja
                        ninja: error: loading 'build.ninja': The system cannot find the file specified.

                        where is configure.exe ?

                        A 1 Reply Last reply 10 Mar 2024, 17:24
                        0
                        • J jdent
                          10 Mar 2024, 15:18

                          @Axel-Spoerl you mean like this:

                          U:\Qt\Tools\Ninja>ninja
                          ninja: error: loading 'build.ninja': The system cannot find the file specified.

                          where is configure.exe ?

                          A Online
                          A Online
                          Axel Spoerl
                          Moderators
                          wrote on 10 Mar 2024, 17:24 last edited by
                          #12

                          @jdent
                          Well, that's a path issue.
                          You have to configure the PATH environment variable in your system settings and make it point to the ninja executable in the Qt installation tree.
                          Same is needed for CMake.

                          configure.batis in your source tree.

                          Software Engineer
                          The Qt Company, Oslo

                          J 1 Reply Last reply 10 Mar 2024, 19:51
                          0
                          • A Axel Spoerl
                            10 Mar 2024, 17:24

                            @jdent
                            Well, that's a path issue.
                            You have to configure the PATH environment variable in your system settings and make it point to the ninja executable in the Qt installation tree.
                            Same is needed for CMake.

                            configure.batis in your source tree.

                            J Offline
                            J Offline
                            jdent
                            wrote on 10 Mar 2024, 19:51 last edited by
                            #13

                            @Axel-Spoerl I set the PATH environment to point to Ninja.exe, and now I can run Ninja anywhere. But where should I run it from?
                            The only folder with build.ninja is in U:\Qt\6.6.2\Src\qtwebengine\src\3rdparty\chromium\tools\memory\partition_allocator\palloc_viewer
                            and
                            U:\Qt\6.6.2\Src\qtwebengine\src\3rdparty\ninja\misc\afl-fuzz

                            and configure is a batch file in U:\Qt\6.6.2\Src

                            Is it safe to run these files?

                            A 1 Reply Last reply 10 Mar 2024, 20:38
                            0
                            • J jdent
                              10 Mar 2024, 19:51

                              @Axel-Spoerl I set the PATH environment to point to Ninja.exe, and now I can run Ninja anywhere. But where should I run it from?
                              The only folder with build.ninja is in U:\Qt\6.6.2\Src\qtwebengine\src\3rdparty\chromium\tools\memory\partition_allocator\palloc_viewer
                              and
                              U:\Qt\6.6.2\Src\qtwebengine\src\3rdparty\ninja\misc\afl-fuzz

                              and configure is a batch file in U:\Qt\6.6.2\Src

                              Is it safe to run these files?

                              A Online
                              A Online
                              Axel Spoerl
                              Moderators
                              wrote on 10 Mar 2024, 20:38 last edited by
                              #14

                              @jdent
                              If build.ninja isn’t found, configure hasn’t been run or hasn’t finished properly. I’ll not say whether configure.bat is safe on your system. If you have cloned Qt from a recent, safe source and not made any modifications, it should be.

                              Software Engineer
                              The Qt Company, Oslo

                              cristian-adamC 1 Reply Last reply 11 Mar 2024, 10:25
                              0
                              • A Axel Spoerl
                                10 Mar 2024, 20:38

                                @jdent
                                If build.ninja isn’t found, configure hasn’t been run or hasn’t finished properly. I’ll not say whether configure.bat is safe on your system. If you have cloned Qt from a recent, safe source and not made any modifications, it should be.

                                cristian-adamC Offline
                                cristian-adamC Offline
                                cristian-adam
                                wrote on 11 Mar 2024, 10:25 last edited by
                                #15

                                @Axel-Spoerl I don't think @jdent wants to build Qt here.

                                It' that his Qt example doesn't compile with his setup.

                                @jdent can you try a shorter path for your example? There are issues on Windows with Qt Design Studio projects and long project paths.

                                J 1 Reply Last reply 11 Mar 2024, 18:24
                                0
                                • cristian-adamC cristian-adam
                                  11 Mar 2024, 10:25

                                  @Axel-Spoerl I don't think @jdent wants to build Qt here.

                                  It' that his Qt example doesn't compile with his setup.

                                  @jdent can you try a shorter path for your example? There are issues on Windows with Qt Design Studio projects and long project paths.

                                  J Offline
                                  J Offline
                                  jdent
                                  wrote on 11 Mar 2024, 18:24 last edited by
                                  #16

                                  @cristian-adam My path is already small since QT root is at U:\Qt
                                  How would I move the example to a shorter directory?

                                  You are correct I am not building source but an example

                                  Please help!

                                  cristian-adamC 1 Reply Last reply 12 Mar 2024, 11:22
                                  0
                                  • J jdent
                                    11 Mar 2024, 18:24

                                    @cristian-adam My path is already small since QT root is at U:\Qt
                                    How would I move the example to a shorter directory?

                                    You are correct I am not building source but an example

                                    Please help!

                                    cristian-adamC Offline
                                    cristian-adamC Offline
                                    cristian-adam
                                    wrote on 12 Mar 2024, 11:22 last edited by
                                    #17

                                    @jdent U:\Users\Juan Dent\Qt\with QtCreator\build-QtQuickApp-Desktop_Qt_6_6_2_MSVC2019_64bit-Debug_deps is a bit long.

                                    Have a look at https://bugreports.qt.io/browse/QTBUG-117413
                                    and if you are building a Qt Design Studio project change the corresponding CMake code like this:

                                    if (BUILD_QDS_COMPONENTS)
                                        if (WIN32)
                                            set(FETCHCONTENT_BASE_DIR $ENV{HOMEDRIVE}/bld/qds-deps) # <---- new line
                                        endif()
                                        include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents)
                                    endif() 
                                    
                                    1 Reply Last reply
                                    0

                                    1/17

                                    9 Mar 2024, 17:55

                                    • Login

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