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. Error while building/deploying project ... when executing step "CMake Build" !
QtWS25 Last Chance

Error while building/deploying project ... when executing step "CMake Build" !

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
10 Posts 3 Posters 3.2k 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.
  • N Offline
    N Offline
    Nima Ghorab
    wrote on last edited by Nima Ghorab
    #1

    Hey guys!
    I have wired problem with Qt Creator and CMake.
    Without any good reason Qt Creator showing this error:
    Error while building/deploying project Practice_CMake (kit: Desktop Qt 5.12.1 MSVC2017 64bit)
    When executing step "CMake Build"

    The only way that I know for temporal fixing is just reopening Qt Creator.
    I saw this topic as well:
    https://forum.qt.io/topic/79928/cmake-build-fails-without-a-good-error-message
    But seems this problem still remains unsolved!
    Any suggestions?
    Thanks on advance!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Can you share your CMakeLists.txt file?

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nima Ghorab
        wrote on last edited by Nima Ghorab
        #3

        @mchinand Sure thing!

        cmake_minimum_required(VERSION 2.8)
        
        project(Practice_CMake)
        
        include_directories(${CMAKE_SOURCE_DIR}/include)
        add_executable(${PROJECT_NAME} "main.cpp")
        
        1 Reply Last reply
        0
        • M Offline
          M Offline
          mchinand
          wrote on last edited by
          #4

          Check out the Qt's CMake documentation. You need to add the find package() and target_link_libraries() lines (modified for your project though).

          N 1 Reply Last reply
          3
          • M mchinand

            Check out the Qt's CMake documentation. You need to add the find package() and target_link_libraries() lines (modified for your project though).

            N Offline
            N Offline
            Nima Ghorab
            wrote on last edited by
            #5

            Thank you dear @mchinand!
            Are sure about this?
            Because program compiles and builds successfully and suddenly it gives that error without changing anything in CMakeList.txt!
            After reopening Qt everything will back to normal!
            Thank you so much!

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mchinand
              wrote on last edited by mchinand
              #6

              I assumed you are using Qt in your application, but I see that the post you referenced specified that they are having an issue with for a non-Qt CMake project. You don't need those lines if you're not using Qt in your application (ie, no QApplication, QWidgets, etc.). You are reopening QtCreator, not Qt.

              N 1 Reply Last reply
              0
              • M mchinand

                I assumed you are using Qt in your application, but I see that the post you referenced specified that they are having an issue with for a non-Qt CMake project. You don't need those lines if you're not using Qt in your application (ie, no QApplication, QWidgets, etc.). You are reopening QtCreator, not Qt.

                N Offline
                N Offline
                Nima Ghorab
                wrote on last edited by
                #7

                @mchinand Really thanks man!
                Seems there is no deterministic way for solving this problem so far!
                I think this problem persists even if we use CMake with Qt project including QApplication and ...

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mchinand
                  wrote on last edited by
                  #8

                  Perhaps try a newer version of CMake if you are not already using the latest version (and start with a completely fresh build directory). I'm not sure that it will make a difference, but the minimum CMake version for Qt5 is 3.1.0 so change your first line to at least that version instead of your current value of 2.8.

                  N 1 Reply Last reply
                  1
                  • M mchinand

                    Perhaps try a newer version of CMake if you are not already using the latest version (and start with a completely fresh build directory). I'm not sure that it will make a difference, but the minimum CMake version for Qt5 is 3.1.0 so change your first line to at least that version instead of your current value of 2.8.

                    N Offline
                    N Offline
                    Nima Ghorab
                    wrote on last edited by
                    #9

                    @mchinand I'm using CMake 3.14.0 which is the latest release until now without luck!

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jcren
                      wrote on last edited by
                      #10

                      I also encountered this problem. When I closed qtcreator and re-opened it, everything is okay though. I am not sure if it is a bug or not. Thank you for your information here.

                      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