Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120317

qt6<target_name>_debug_metatypes.json: illegal value

    XMLWordPrintable

Details

    • Windows
    • db9009721 (dev), 799139c51 (6.7), 3dc6ea099 (6.6), 1d718264c (tqtc/lts-6.5), 3a4397af2 (dev), ab6950aca (6.7), b6ec4be33 (6.6), 65824a925 (tqtc/lts-6.5), 6aed87091 (6.7), d0da8d963 (dev), 6c1e0b50c (6.6), 654f3c563 (dev), 907497b87 (6.7), 292811ec9 (6.6)

    Description

      I am using qt version 6.6.1 with msvc 2019 using nmake to build the project. Previously I used the msbuild system to build my app and I encountered no error. But with nmake, I get errors regarding qmltyperegistration, specifically, the metatypes.json seem to be empty when I configure the build files with cmake.
      Here is the full output log when I build with nmake:

      Unable to find source-code formatter for language: n. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml[build] Starting build[proc] Executing command: C:\Qt\Tools\CMake_64\bin\cmake.EXE --build c:/Users/athar/Documents/ClickerX/build --config Debug --target ClickerX -j 18 --
      [build] Warning: NMake does not support parallel builds. Ignoring parallel build command line option.
      [build] [  3%] Built target ClickerX_qmlimportscan
      [build] [ 11%] Built target ClickerX_tooling[build] [ 15%] Automatic MOC and UIC for target ClickerX
      [build] [ 19%] Built target ClickerX_autogen
      [build] [ 23%] Running AUTOMOC file extraction for target ClickerX
      [build] [ 23%] Built target ClickerX_automoc_json_extraction
      [build] [ 26%] Automatic QML type registration for target ClickerX
      [build] Error 5 while parsing C:/Users/athar/Documents/ClickerX/build/meta_types/qt6clickerx_debug_metatypes.json: illegal value
      [build] NMAKE : fatal error U1077: 'call .qt\bin\qt_setup_tool_path.bat C:/Qt/6.6.1/msvc2019_64/./bin/qmltyperegistrar.exe --generate-qmltypes=C:/Users/athar/Documents/ClickerX/build/qml/ClickerX.qmltypes --import-name=qml --major-version=254 --minor-version=254 @C:/Users/athar/Documents/ClickerX/build/qmltypes/ClickerX_foreign_types.txt -o C:/Users/athar/Documents/ClickerX/build/clickerx_qmltyperegistrations.cpp C:/Users/athar/Documents/ClickerX/build/meta_types/qt6clickerx_debug_metatypes.json' : return code '0x1'
      [build] Stop.
      [build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\ClickerX.dir\build.make /nologo -SL                 CMakeFiles\ClickerX.dir\depend' : return code '0x2'[build] Stop.
      [build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -SL                 CMakeFiles\ClickerX.dir\all' : return code '0x2'[build] Stop.
      [build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -LS                 ClickerX' : return code '0x2'
      [build] Stop.
      [proc] The command: C:\Qt\Tools\CMake_64\bin\cmake.EXE --build c:/Users/athar/Documents/ClickerX/build --config Debug --target ClickerX -j 18 -- exited with code: 2
      [driver] Build completed: 00:00:01.137
      [build] Build finished with exit code 2

      This is the CMake file used to configure the build files:

      cmake_minimum_required(VERSION 3.16)
      project(ClickerX VERSION 1.0.0 LANGUAGES CXX)
      set(CMAKE_CXX_STANDARD 17)
      set(CMAKE_CXX_STANDARD_REQUIRED ON)
      set(CMAKE_PREFIX_PATH "C:/Qt/6.6.1/msvc2019_64")
      set(CMAKE_AUTORCC ON)
      set(CMAKE_AUTOMOC ON)
      find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
      qt_standard_project_setup()
      qt_add_executable(ClickerX    
         src/main.cpp    
         src/ui.cpp    
         include/ui.hpp    
         resources.qrc    
         project.rc
      )
      set_source_files_properties(src/main.qml PROPERTIES QT_RESOURCE_ALIAS main.qml)
      set_source_files_properties(src/components/NumberField.qml PROPERTIES QT_RESOURCE_ALIAS components/NumberField.qml)
      qt_add_qml_module(ClickerX    
         URI qml    
         RESOURCE_PREFIX /    
         QML_FILES        
            src/main.qml        
            src/components/NumberField.qml
      )
      target_link_libraries(ClickerX PRIVATE Qt6::Core Qt6::Gui Qt6::Qml Qt6::Quick) target_include_directories(ClickerX PRIVATE include)
      # set_target_properties(ClickerX PROPERTIES
      #     WIN32_EXECUTABLE ON
      # )

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-120317
          # Subject Branch Project Status CR V

          Activity

            People

              jbornema Joerg Bornemann
              am19 Atharva Mishra
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: