If I write this:
#include "utilities/CpuOutput.h"
Cpu::Cpu(): outputObject(){}
Arduino generate this error ( at line of Cpu::Cpu(): outputObject(){} ): undefined reference to `CpuOutput::~CpuOutput()'
Did you define a destructor? Did you implement the destructor?
Alternatively, if I write this at Cpu.cpp:
#include "utilities/CpuOutput.h"
Cpu::Cpu(){
cpuObject();
}
Arduino generate this error ( at line of cpuObject(); ): no match for call to ‘(CpuOutput) ()’
As well it should. That is NOT how to create an instance of the class. You NEVER call the constructor directly.
So I can't initialize an object properly yet. I don't know what else to do
How about doing what was suggested from the very beginning - post ALL of your code.
If CpuOutput has a no argument constructor, then creating an instance in the Cpu class is trivial. In the Cpu.h file, put
CpuOutput cpuThingy;
When the Cpu class is instantiated, the CpuOutput constructor will be called to initialize cpuThingy.
If it doesn't, then the cpuThingy instance must be explicitly initialized in the Cpu.cpp file, in the constructor initialization sequence:
Cpu::Cpu() : cpuThingy(whatever arguments it needs)
{
}