How to use a library inside another library?

So I'm making a library which is soposed to use another library of mine ("myTimer") to use timing. The library for time works great by itself, but I can't implement it properly in the other library (I'll call it "myOutput" for now), which I will use to controll an output.

I included both libraryes in the main sketch. The code only contains empty "setup()" and "loop()" and I'm just trying to compile the libraryes for now.

The simplified version of the header file of the "myOutput" library looks like this:

#ifndef myOutput_h
#define myOutput_h

#include <Arduino.h>
#include <myTimer.h>

class myOutput{
  
private:
 char inputPin;
 char outputPin;

 myTimer timer1();
 myTimer timer2();
 
public:
 myOutput();
 ~myOutput();
 
 myOutput() : timer1(), timer2(){}

};

#endif

And the cpp file looks something like this:

#include <myTimer.h>
#include <myOutput.h>

myOutput::myOutput(char in, char out){
  inputPin = in;
  outputPin = out;
}
myOutput::myTimer timer1;
myOutput::myTimer timer2;

"myTimer" class has it's own constructor with some input values, but in this case I'm just using preset defoult values.

The error I get is: error: '((myOutput*)this)->myOutput::timer2' does not have class type

I have no idea what I hav to do to make this work, If you have any suggestions I would apreciate it.

Thank you.

So I'm making a library which is soposed to use another library of mine ("myTimer") to use timing. The library for time works great by itself, but I can't implement it properly in the other library (I'll call it "myOutput" for now), which I will use to controll an output.

Not to be too picky, but if you decide to share the code, it's going to be a laughingstock with those names.

Perhaps you've noticed that it's not myAnalogRead(), myDigitalWrite(), etc.

You have two header files, two source files, and a sketch. You posted 2 of the 5, and expect us to know what's wrong. Well, I have a really good idea, but you need to post ALL FIVE FILES COMPLETELY (not "something like").

By the way, there was a hint there...

I have managed to get it working. I used initialization lists (which I don't quite understand yet).

This is the H file:

#ifndef dimmButton_h
#define dimmButton_h

#include <Arduino.h>
#include <myTimer.h>

class myOutput{

public:
  myOutput(int intVar);
  ~myOutput();

private:
  myTimer timer1;        //here I just declared objects
  myTimer timer2;
};

#endif

and the CPP file looks like this:

#include <myTimer.h>

myOutput::myOutput(int intVar) : timer1(), timer2(){     // and here I initialized them
  
  //some code here

}

This is essnetialy how I did it. I know it's not such a big deal, but it took me a long time to figure it out. Sorry if the names seemed inappropriate to some. Hopefully someone will find this usefull.