Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Unable To Build Fresh QT Quick Application
Forum Updated to NodeBB v4.3 + New Features

Unable To Build Fresh QT Quick Application

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 354 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.
  • C Offline
    C Offline
    Cbarb15
    wrote on last edited by
    #1

    I am trying to learn how to use QT Quick and I created a simple project and just trying to build it straight after creating it and it throws these errors.
    qml.png
    and the general logs
    generalLog.png

    As I am able to create a qt widget application and compile it just after it's creation, it does not seem like it would be a cmake problem. I could be wrong though.

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      Hi and welcome to the forum,
      Please also don't post pictures of text, just post the text directly, using the </> code formatting tags
      Start doing so with your CMakeLists.txt.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Cbarb15
        wrote on last edited by Cbarb15
        #3

        Cmake

        cmake_minimum_required(VERSION 3.16)
        
        project(RemoteDisplay VERSION 0.1 LANGUAGES CXX)
        
        set(CMAKE_CXX_STANDARD_REQUIRED ON)
        
        find_package(Qt6 6.5 REQUIRED COMPONENTS Quick)
        
        qt_standard_project_setup(REQUIRES 6.5)
        
        qt_add_executable(appRemoteDisplay
            main.cpp
        )
        
        qt_add_qml_module(appRemoteDisplay
            URI RemoteDisplay
            VERSION 1.0
            QML_FILES
                Main.qml
        )
        
        # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
        # If you are developing for iOS or macOS you should consider setting an
        # explicit, fixed bundle identifier manually though.
        set_target_properties(appRemoteDisplay PROPERTIES
        #    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appRemoteDisplay
            MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
            MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
            MACOSX_BUNDLE TRUE
            WIN32_EXECUTABLE TRUE
        )
        
        target_link_libraries(appRemoteDisplay
            PRIVATE Qt6::Quick
        )
        
        include(GNUInstallDirs)
        install(TARGETS appRemoteDisplay
            BUNDLE DESTINATION .
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
        )
        
        
        1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          Looks about right.
          What does the compile output say?

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Cbarb15
            wrote on last edited by Cbarb15
            #5

            There is no compiled output. There are issues that say

            Failed to scan target appDisplay for QML imports; 1
            
            The command "C:\cmake-3.31.0-rc2-windows-x86_64\cmake-3.31.0-rc2-windows-x86_64\bin\cmake.exe -S "C:/Users/cbarb/Documents/QT Projects/Display" -B "C:/Users/cbarb/Documents/QT Projects/Display/build/Desktop_Qt_6_8_0_MinGW_64_bit-Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/mingw1310_64/bin/g++.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.8.0/mingw_64/bin/qmake.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.8.0/mingw_64" "-DCMAKE_GENERATOR:STRING=MinGW Makefiles" "-DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/mingw1310_64/bin/gcc.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\cbarb\Documents\QT Projects\Display\build\Desktop_Qt_6_8_0_MinGW_64_bit-Debug/.qtc/package-manager/auto-setup.cmake"" terminated with exit code 1.
            
            CMake project configuration failed. No CMake configuration for build type "Debug" found. Check General Messages for more information.
            
            1 Reply Last reply
            0
            • Axel SpoerlA Offline
              Axel SpoerlA Offline
              Axel Spoerl
              Moderators
              wrote on last edited by
              #6

              The issues are just a summary of the compile out put. It’s Tab Nr. 4 according to your screen shot.

              Software Engineer
              The Qt Company, Oslo

              1 Reply Last reply
              0

              • Login

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