Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-33619

Applying quick fix breaks project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • Qt Creator 17.0.2, Qt Creator 18.0.0-beta2
    • None
    • Ubuntu 24.04 LTS

      1. Create a new "Qt Console Application" project using the wizard.
        Use defaults, including "CMake for Qt 5 and Qt 6".
      2. Build the project.
        That works.
      3. In the project's main.cpp, instantiate a QSvgGenerator object:
        QSvgGenerator qsg;
        

        The code model notices that it's an "unknown type name".

      4. Move the cursor to "QSvgGenerator", trigger quick fixes (Alt+Enter), select "Add #include <QSvgGenerator> and Project Dependency Qt.Svg" and press Enter.
        The project cannot be built anymore. In "Compile Output" view, I can read:
        01:01:19: Running steps for project untitled...
        01:01:19: Starting: "/usr/bin/cmake" --build /tmp/projekte/untitled/build/Desktop_Qt_6_10_0-Debug --target all
        [0/1 0.0/sec] Re-running CMake...
        -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
        CMake Error at CMakeLists.txt:21 (target_link_libraries):
          The plain signature for target_link_libraries has already been used with
          the target "untitled".  All uses of target_link_libraries with a target
          must be either all-keyword or all-plain.
        
          The uses of the plain signature are here:
        
           * CMakeLists.txt:20 (target_link_libraries)
        
        
        
        -- Configuring incomplete, errors occurred!
        FAILED: build.ninja 
        /usr/bin/cmake --regenerate-during-build -S/tmp/projekte/untitled -B/tmp/projekte/untitled/build/Desktop_Qt_6_10_0-Debug
        ninja: error: rebuilding 'build.ninja': subcommand failed
        01:01:19: The command "/usr/bin/cmake --build /tmp/projekte/untitled/build/Desktop_Qt_6_10_0-Debug --target all" terminated with exit code 1.
        01:01:19: Error while building/deploying project untitled (kit: Desktop Qt 6.10.0)
        01:01:19: When executing step "Build"
        01:01:19: Elapsed time: 00:00.
        

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cadam Cristian Adam
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes