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. Unknown type name: QProcess

Unknown type name: QProcess

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 4 Posters 148 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.
  • I Offline
    I Offline
    IanB
    wrote on 2 Apr 2025, 22:01 last edited by
    #1

    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?

    J J 2 Replies Last reply 3 Apr 2025, 05:13
    0
    • I IanB
      2 Apr 2025, 22:01

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 3 Apr 2025, 05:13 last edited by
      #2

      @IanB So, your application is building and running fine, but QtCreator shows that error? This is the code model, which simetimes produces false positives.

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

      1 Reply Last reply
      0
      • C Christian Ehrlicher moved this topic from Installation and Deployment on 3 Apr 2025, 05:16
      • I IanB
        2 Apr 2025, 22:01

        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?

        J Online
        J Online
        JonB
        wrote on 3 Apr 2025, 07:22 last edited by
        #3

        @IanB said in Unknown type name: QProcess:

        The compile always fails with this error.

        @jsulm is asking/guessing whether this is a compiler error or just an error shown to you in the editor but not when you actually compile? Please answer clearly.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cristian-adam
          wrote on 4 Apr 2025, 08:18 last edited by
          #4

          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:

          1. Open Xcode
          2. Go to Preferences Cmd + ,
          3. Go to Location
          4. At the Command Line Tools: combobox select something there. I have Xcode 16.2 (16C5032a).
          1 Reply Last reply
          0

          4/4

          4 Apr 2025, 08:18

          • Login

          • Login or register to search.
          4 out of 4
          • First post
            4/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved