Basically this:
Car and Truck are both derived from the Vehicle class.
Car.h
#include "Vehicle.h"
class Car : public Vehicle {
//blah blah blah
Truck.h
#include "Vehicle.h"
class Truck : public Vehicle {
//blah blah blah
Main.cpp
#include "Car.h"
#include "Truck.h"
My issue is that I get a class redefinition error on Truck (due to it calling Vehicle a second time) when I have the #include line there, but when I remove it, I have the "expected class name before { token".
I get that with Main -> Car -> Vehicle Main -> Truck -> Vehicle (redefinition)
will cause an error.
But if I remove the #include "Vehicle.h" from Truck it also causes another error where it expects a class name.