Invalid C++ errors when running pio build in Clion on Mac M3

But if I don’t have the subclasses in the superclass’s header file, how is it going to know about them? I’m using a standard pattern, Factory method, to create the subclasses I need for a given situation. No, I believe this code is correct. If you’re using Clion as your IDE, you will see that there are green arrows in the upper right corner of each file.

Check the repo. I made a commit to fix the includes and break the circular dependency.

Good to go. I guess I thought that I should move the subclass definitions to the .h file, but I see now that it wasn’t appropriate in this case. Thanks so much for your help.

1 Like