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. qt_add_resources error
Forum Updated to NodeBB v4.3 + New Features

qt_add_resources error

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 401 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.
  • A Offline
    A Offline
    abdelmaegd
    wrote on last edited by
    #1

    I'm trying to use CMake macro qt_add_resources, and add qrc file that has comments, and it seems this makes generate rules including the comments add dependencies.

    Example:
    resourcesq.qrc

    <!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
         +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
         my quoted comment is here "<file>"s after quoted comment
         +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    -->
    <RCC>
        <qresource prefix="/guiResources">
           <file>fnGettingStarted.txt</file>
    <!-- EXAMPLE OF USING FILE ALIAS
           <file alias="bang.svg">images/bangCircleYellow.svg</file>
    -->
        </qresource>
    </RCC>
    

    CMakeLists.txt

    cmake_minimum_required(VERSION 3.18)
    project(hello_qrc VERSION 1.0)
    
    find_package(Qt5 REQUIRED COMPONENTS Core Gui)
    
    qt_add_resources(SOURCES resources.qrc)
    
    add_library(lib ${SOURCES})
    

    This is the error during cmake --build build -t lib

    ninja: error: '/home/abdelmak/sandbox/cmake/rcc/"s after quoted comment     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->/home/abdelmak/sandbox/cmake/rcc/fnGettingStarted.txt', needed by '/home/abdelmak/sandbox/cmake/rcc/build/qrc_resources.cpp', missing and no known rule to make it
    

    If I remove the upper comment and keep the comment at the end, it errors also with

    ninja: error: '/home/abdelmak/sandbox/cmake/rcc/images/bangCircleYellow.svg', needed by '/home/abdelmak/sandbox/cmake/rcc/build/qrc_resources.cpp', missing and no known rule to make it
    

    Is this issue in the macro itself ?

    Christian EhrlicherC 1 Reply Last reply
    0
    • A abdelmaegd

      I'm trying to use CMake macro qt_add_resources, and add qrc file that has comments, and it seems this makes generate rules including the comments add dependencies.

      Example:
      resourcesq.qrc

      <!-- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
           +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           my quoted comment is here "<file>"s after quoted comment
           +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      -->
      <RCC>
          <qresource prefix="/guiResources">
             <file>fnGettingStarted.txt</file>
      <!-- EXAMPLE OF USING FILE ALIAS
             <file alias="bang.svg">images/bangCircleYellow.svg</file>
      -->
          </qresource>
      </RCC>
      

      CMakeLists.txt

      cmake_minimum_required(VERSION 3.18)
      project(hello_qrc VERSION 1.0)
      
      find_package(Qt5 REQUIRED COMPONENTS Core Gui)
      
      qt_add_resources(SOURCES resources.qrc)
      
      add_library(lib ${SOURCES})
      

      This is the error during cmake --build build -t lib

      ninja: error: '/home/abdelmak/sandbox/cmake/rcc/"s after quoted comment     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->/home/abdelmak/sandbox/cmake/rcc/fnGettingStarted.txt', needed by '/home/abdelmak/sandbox/cmake/rcc/build/qrc_resources.cpp', missing and no known rule to make it
      

      If I remove the upper comment and keep the comment at the end, it errors also with

      ninja: error: '/home/abdelmak/sandbox/cmake/rcc/images/bangCircleYellow.svg', needed by '/home/abdelmak/sandbox/cmake/rcc/build/qrc_resources.cpp', missing and no known rule to make it
      

      Is this issue in the macro itself ?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @abdelmaegd said in qt_add_resources error:

      Is this issue in the macro itself ?

      No since the macro only invokes cmake and rcc so you should create a cmake bug report but I doubt this will get high priority - even you're correct a qrc file is not meant to be modifed by anything else but the Qt tools.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      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