Error while building/deploying project ... when executing step "CMake Build" !
-
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! -
@mchinand Sure thing!
cmake_minimum_required(VERSION 2.8) project(Practice_CMake) include_directories(${CMAKE_SOURCE_DIR}/include) add_executable(${PROJECT_NAME} "main.cpp")
-
Check out the Qt's CMake documentation. You need to add the
find package()
andtarget_link_libraries()
lines (modified for your project though). -
Check out the Qt's CMake documentation. You need to add the
find package()
andtarget_link_libraries()
lines (modified for your project though).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! -
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.
-
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.
@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 ... -
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.
-
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.
@mchinand I'm using CMake 3.14.0 which is the latest release until now without luck!