QT Creator 14.0.1 - ninja: build stopped: subcommand failed
-
Hi,
I am running QT Creator 14.0.1 on my iMac M1 (apple silicon) with Sonoma 14.6.1 and I follow this tutorial ([https://www.udemy.com/course/qt5-gui-cpp-programming-tutorial-2d-graphics/learn/lecture/6178288#overview](link URL)). Which is a C++ and CMAKE project.
When I run the project I am getting 2 Errors, which I am hoping are reporting the same issue:-
- 'renderarea.h' file not found - This include file was generated by QT Creator, so how can it not be found??
- ninja: build stopped: subcommand failed.
If this helps here is the output from the compiler, which I don't understand.
16:29:46: Running steps for project QTCurvesCPP2... 16:29:46: Starting: "/Applications/qt/Tools/CMake/CMake.app/Contents/bin/cmake" --build /Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug --target all [0/2 0.0/sec] Re-checking globbed directories... -- GLOB mismatch! -- GLOB mismatch! [1/2 16.4/sec] Re-running CMake... -- Configuring done (0.1s) -- Generating done (0.0s) -- Build files have been written to: /Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug [0/4 0.0/sec] Re-checking globbed directories... [1/5 1.6/sec] Building CXX object CMakeFiles/QTCurvesCPP2.dir/mainwindow.cpp.o FAILED: CMakeFiles/QTCurvesCPP2.dir/mainwindow.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I/Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug/QTCurvesCPP2_autogen/include -isystem /Applications/qt/6.7.2/macos/lib/QtCore.framework/Headers -iframework /Applications/qt/6.7.2/macos/lib -isystem /Applications/qt/6.7.2/macos/mkspecs/macx-clang -isystem /Applications/qt/6.7.2/macos/include -isystem /Applications/qt/6.7.2/macos/lib/QtWidgets.framework/Headers -isystem /Applications/qt/6.7.2/macos/lib/QtGui.framework/Headers -DQT_QML_DEBUG -g -std=gnu++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fcolor-diagnostics -MD -MT CMakeFiles/QTCurvesCPP2.dir/mainwindow.cpp.o -MF CMakeFiles/QTCurvesCPP2.dir/mainwindow.cpp.o.d -o CMakeFiles/QTCurvesCPP2.dir/mainwindow.cpp.o -c /Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/mainwindow.cpp In file included from /Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/mainwindow.cpp:2: /Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug/QTCurvesCPP2_autogen/include/./ui_mainwindow.h:17:10: fatal error: 'renderarea.h' file not found #include "renderarea.h" ^~~~~~~~~~~~~~ 1 error generated. ninja: build stopped: subcommand failed. 16:29:47: The process "/Applications/qt/Tools/CMake/CMake.app/Contents/bin/cmake" exited with code 1. Error while building/deploying project QTCurvesCPP2 (kit: Desktop (arm-darwin-generic-mach_o-64bit)) When executing step "Build" 16:29:47: Elapsed time: 00:01.
I have "Cleaned" the project and "Rebuilt" it. I also renamed the "build.ninja" file, which worsened things, so I had to put it back. Finally, I deleted the project and started again, but I still got the same error.
Please can anyone help?
-
Post your code, using the </> code tags of the editor.
Don't post external links to code. The one you posted doesn't work, if someone (like me) doesn't have a udemy account.In your case, as the error message indicates,
renderarea.h
isn't found in your include path.
That has nothing to do with Qt Creator. The file is either missing, or the include path is wrong.
Contact Udemy for a fix. -
Hi Axel,
Thank you for your reply, I thought I had posted my code with </> code tags, In future I won't post external links. However, the renderarea.h, as I mentioned, was created by QT Creator not by me or at the suggestion of Udemy, and the file does exist and is in the include directory that was also created by QT Creator. So I am surprised that the build could not find it, and cannot see how Udemy is to blame. Finally do yu have any comment to make about the second fault.
-
The second failure
ninja: build stopped: subcommand failed.
is a direct successor of the first error.Fix the first error, and the second will disappear.
the file does exist and is in the include directory
Can you tell us the path to this directory?
According to the compiler command line, your compiler searches in the following directories:
-I/Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug/QTCurvesCPP2_autogen/include -isystem /Applications/qt/6.7.2/macos/lib/QtCore.framework/Headers -iframework /Applications/qt/6.7.2/macos/lib -isystem /Applications/qt/6.7.2/macos/mkspecs/macx-clang -isystem /Applications/qt/6.7.2/macos/include -isystem /Applications/qt/6.7.2/macos/lib/QtWidgets.framework/Headers -isystem /Applications/qt/6.7.2/macos/lib/QtGui.framework/Headers
which seems a bit strange to me as it does not have any source directory in the list.
Can you show your
CMakeLists.txt
?