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. When building a project using CMake, an error occurs when generating the target
Forum Update on Monday, May 27th 2025

When building a project using CMake, an error occurs when generating the target

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
8 Posts 4 Posters 429 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
    Alex0718
    wrote on 26 Jun 2024, 06:42 last edited by
    #1

    I've previously built four or five projects for learning with no problems, and today, about three or four days apart, I've noticed that no matter how I recreate a new project, it shows an error:

    :-1: error: [CMakeFiles\apptest.dir\build.make:88: apptest_qmltyperegistrations.cpp] Error 1

    c1320215-c861-43ec-ad06-89af72782326-image.png

    This is the CMake I installed:
    e825ec77-93c1-4fc4-812b-3f6cfa58db49-image.png

    This is the CMake configuration:
    1a415828-6d4b-4f6d-8ea0-747226a7ab7b-image.png

    03984d28-42dc-40a7-8729-88badce757ad-image.png

    How to resolve this error message?

    J 1 Reply Last reply 26 Jun 2024, 06:51
    0
    • A Alex0718
      26 Jun 2024, 06:42

      I've previously built four or five projects for learning with no problems, and today, about three or four days apart, I've noticed that no matter how I recreate a new project, it shows an error:

      :-1: error: [CMakeFiles\apptest.dir\build.make:88: apptest_qmltyperegistrations.cpp] Error 1

      c1320215-c861-43ec-ad06-89af72782326-image.png

      This is the CMake I installed:
      e825ec77-93c1-4fc4-812b-3f6cfa58db49-image.png

      This is the CMake configuration:
      1a415828-6d4b-4f6d-8ea0-747226a7ab7b-image.png

      03984d28-42dc-40a7-8729-88badce757ad-image.png

      How to resolve this error message?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 26 Jun 2024, 06:51 last edited by
      #2

      @Alex0718 Do you use CMake provided together with Qt?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 26 Jun 2024, 06:58
      0
      • J jsulm
        26 Jun 2024, 06:51

        @Alex0718 Do you use CMake provided together with Qt?

        A Offline
        A Offline
        Alex0718
        wrote on 26 Jun 2024, 06:58 last edited by
        #3

        @jsulm Yes, I've created a few projects before that have compiled without problems, I don't know why the project I created this time keeps compiling with errors.
        611edd52-7e57-4056-86c1-255b5c85c2ad-image.png

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 26 Jun 2024, 13:58 last edited by
          #4

          You did not answer the question. I know that you installed CMake provided by the Qt installer. But the question is: do you also use it? Check the Kit you're using: which CMake executable is selected there?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply 27 Jun 2024, 01:26
          0
          • C Offline
            C Offline
            cristian-adam
            wrote on 26 Jun 2024, 14:06 last edited by
            #5

            Please do try to install "Ninja" from the Qt SDK or from https://github.com/ninja-build/ninja/releases. Make sure that you Kit has the "Ninja" generator selected for the CMake generator.

            Then do a clean build of your application. (Build > Clear CMake Configuration and afterwards Build > Run CMake)

            A 1 Reply Last reply 27 Jun 2024, 02:34
            0
            • J jsulm
              26 Jun 2024, 13:58

              You did not answer the question. I know that you installed CMake provided by the Qt installer. But the question is: do you also use it? Check the Kit you're using: which CMake executable is selected there?

              A Offline
              A Offline
              Alex0718
              wrote on 27 Jun 2024, 01:26 last edited by
              #6

              @jsulm The CMake provided by QT is indeed used, and this is the path to CMake in the kit configuration.

              e5a486d5-340b-4a5b-babc-6dc387431879-image.png

              1 Reply Last reply
              0
              • C cristian-adam
                26 Jun 2024, 14:06

                Please do try to install "Ninja" from the Qt SDK or from https://github.com/ninja-build/ninja/releases. Make sure that you Kit has the "Ninja" generator selected for the CMake generator.

                Then do a clean build of your application. (Build > Clear CMake Configuration and afterwards Build > Run CMake)

                A Offline
                A Offline
                Alex0718
                wrote on 27 Jun 2024, 02:34 last edited by
                #7

                @cristian-adam Thanks, I'll try your solution.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  zjf_ccok
                  wrote on 27 Jul 2024, 04:51 last edited by
                  #8

                  Have you solved it now?

                  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