Compile error in library with MsTimer2

I have a sketch that compiles without errors.
If I turn it into a library, I get following errors:

D:\Arduino\libraries\DCF77\DCF77.cpp: In member function 'void DCF77::Stop()':
D:\Arduino\libraries\DCF77\DCF77.cpp:94: error: 'MsTimer2' has not been declared
D:\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::setTimer(int)':
D:\Arduino\libraries\DCF77\DCF77.cpp:223: error: 'MsTimer2' has not been declared
D:\Arduino\libraries\DCF77\DCF77.cpp:224: error: 'MsTimer2' has not been declared
D:\Arduino\libraries\DCF77\DCF77.cpp:225: error: 'MsTimer2' has not been declared

What am I doing wrong?
Below the concerning code from DCF77.cpp:

#include <MsTimer2.h>

/**

  • Stop receiving DCF77 information
    */
    void DCF77::Stop(void) {
    detachInterrupt(dCFinterrupt);
    MsTimer2::stop();
    initialized = false;
    }

/**

  • Set the timer to mSeconds and set the ISR
    */
    inline void DCF77::setTimer(int mSeconds) {
    MsTimer2::stop();
    MsTimer2::set(mSeconds, processSignal);
    MsTimer2::start();
    }

What am I doing wrong?

Not showing the sketch that illustrates the problem.

This is the code

DCF77.cpp (13 KB)

This is the code

But, not the sketch that causes the error message.

Yes, it is.
And this id the header.

DCF77.h (4.07 KB)

Yes, it is.

A sketch has a setup() and a loop() function. Neither of them have been evident in the files you've posted.

The scetch

SyncProvider.ino (2.18 KB)

OK. The problem is that the sketch doesn't include the MsTimer2 header file. So, the header file is not copied to the build directory, so the DCF77 source file can't include it. So, when compiling DCF77, MsTimer2 IS undefined.

You can't hide the use of a library. That's simply not allowed.

Thanks a lot. It works. I would never have guessed that.

PaulS:
OK. The problem is that the sketch doesn't include the MsTimer2 header file. So, the header file is not copied to the build directory, so the DCF77 source file can't include it. So, when compiling DCF77, MsTimer2 IS undefined.

You can't hide the use of a library. That's simply not allowed.

?? I do not understand. looks like MsTimer2 header file was included just above the first comment

#include <MsTimer2.h>

/**

  • Stop receiving DCF77 information

?? I do not understand. looks like MsTimer2 header file was included just above the first comment

That is above the first comment in the library source file. That is not the sketch you are looking at. That was added as an attachment later, and does NOT include the MsTimer2 header.