If you are moving things to separate libraries, you need to include the definitions for class DS1307 and RTC so that the library can see it. Typically this would be done in a common include file.
In file.h you would have:
extern DS1307 RTC;
and it file.cpp you would have:
// Define RTC
Note, when you have .cpp files, you need to make sure you have the prototypes for the functions declared before they are used, since this is something the IDE does behind your back for .ino/.pde files.
At the advanced C++ level, there are the concepts of public
, and friend
, superclasses, subclasses that can be used, but that is probably a more complex task.