0

i split a class into two classes, now the editor recognizes types, but compiler does not.

CControls.h

class CControls : public QThread
{
    CControls();
}

CThreadController.h

#include "CControls.h"

class CThreadController : public QThread
{
    Q_OBJECT
    CControls *m_controls;
}

error

/home/michaeleric/Qt_Creator_Projects/GUI/CThreadController.h:22: error: ‘CControls’ does not name a type
22 |         CControls *m_controls;
  |         ^~~~~~~~~

i dont get how the editor sees CControls as a type, but compiler does not. i dont know qhat else to look at or for.

what is going on?

1 Answers1

0

i commented out //#include "CThreadController.h" from CController.h, and it got rid of error. I am guessing the two can not have each other in, now I have to figure out how to get the two classes to talk to each other.

Philipp Ludwig
  • 3,758
  • 3
  • 30
  • 48
  • https://stackoverflow.com/questions/994253/two-classes-that-refer-to-each-other – Michael Bridges Sep 05 '22 at 01:34
  • 1
    if you're using Creator, re-enable that commented line and look at the Include Heirarchy (it's one of the options in the viewer column on the left of Creator). This should confirm whether you have a circular include issue. – mzimmers Sep 05 '22 at 14:31