Unknown type name: QProcess
-
Using clangd on a mac, the following code gives me an error: Unknown type name: QProcess.
Clangd presents no error for the #include <QProcess>, and the QProcess files are in the Qt Core folder.
I have tried:
a. Upgrading/downgrading Xcode
b. Qt 6.7.0, Qt 6.8.0, Qt6.9.0
c. Compiling without clangd.
The compile always fails with this error.#include <QObject> #include <QProcess> class ProcessTest : public QObject { Q_OBJECT public: explicit ProcessTest(QObject *parent = nullptr); private: QProcess test; };
I have included in my CMakeLists.txt
find_package(Qt6 REQUIRED COMPONENTS Quick Core) target_link_libraries(appTest PRIVATE Qt6::Quick Qt6::Core )
All the examples of using QProcess seem the same, so I have run out of ideas. Any suggestions?
-
Using clangd on a mac, the following code gives me an error: Unknown type name: QProcess.
Clangd presents no error for the #include <QProcess>, and the QProcess files are in the Qt Core folder.
I have tried:
a. Upgrading/downgrading Xcode
b. Qt 6.7.0, Qt 6.8.0, Qt6.9.0
c. Compiling without clangd.
The compile always fails with this error.#include <QObject> #include <QProcess> class ProcessTest : public QObject { Q_OBJECT public: explicit ProcessTest(QObject *parent = nullptr); private: QProcess test; };
I have included in my CMakeLists.txt
find_package(Qt6 REQUIRED COMPONENTS Quick Core) target_link_libraries(appTest PRIVATE Qt6::Quick Qt6::Core )
All the examples of using QProcess seem the same, so I have run out of ideas. Any suggestions?
-
C Christian Ehrlicher moved this topic from Installation and Deployment
-
Using clangd on a mac, the following code gives me an error: Unknown type name: QProcess.
Clangd presents no error for the #include <QProcess>, and the QProcess files are in the Qt Core folder.
I have tried:
a. Upgrading/downgrading Xcode
b. Qt 6.7.0, Qt 6.8.0, Qt6.9.0
c. Compiling without clangd.
The compile always fails with this error.#include <QObject> #include <QProcess> class ProcessTest : public QObject { Q_OBJECT public: explicit ProcessTest(QObject *parent = nullptr); private: QProcess test; };
I have included in my CMakeLists.txt
find_package(Qt6 REQUIRED COMPONENTS Quick Core) target_link_libraries(appTest PRIVATE Qt6::Quick Qt6::Core )
All the examples of using QProcess seem the same, so I have run out of ideas. Any suggestions?
-
You can get CMake to be verbose with the build process by going to Project Mode > Build Steps > CMake arguments and add
--verbose
.Then you can see the commands it tries to build.
Building with Qt 6.7, 6.8 or 6.9 on macOS with Xcode is something that works just fine.
I can think of only having to "activate" the Command Line Tools for Xcode. Please do try to:
- Open Xcode
- Go to Preferences
Cmd + ,
- Go to Location
- At the Command Line Tools: combobox select something there. I have Xcode 16.2 (16C5032a).