problem creating new library.

All dears,
my name is Sergio, from Italy. This is my firts post, in Arduino forum. I’m working with Arduino Leonardo, and own several of them, they are super!
Now I have to do develop one libray in c or cpp language, in order to manage one o two Timers (1 and 3) for creating a precise time pulse. So a have decide to start with a standard Tone libray, just to have a template. I move it from its original position in IDE and put it in the standard library folder of the Arduino IDE 1.0.5-r2, and changed its original file name, now LibMotori.cpp. I have not modified its contents, just to try if my .ino programm works again. Note that I moved the original one form its folder, so the IDE has to use my one. I compile it but I get several error, lke that:

… undefined reference to `tone(unsigned char, unsigned int, unsigned long).

So I have tried to write an header file LibMotori.h where declare the function (tone(), noTone()) and include also the <inttypes.h> on it. I have included it in my .ino program but in this case I get the several errors relative to the LibMotori.h:

… error: variable or field ‘tone’ declared void
… error: ‘uint8_t’ was not declared in this scope
Of corse I tried to change the name of my .ino file, and, after a libray modification I restated the IDE, but it not works at all. If same body can help my.

Thanks in advance for support and best regards,

Perhaps if you posted your code, rather than just talking about it ...

Thanks, for your answer.
This is the .ino code. It works only if the tone.cpp libray is inside the original IDE folder. If I move it in library folder it not works at all. I wont to move the tone.cpp in order to use it as template for my own library that has to manage one or two timer of Leonardo.

Thanks a lot and best regards,

void setup()

void runspeed(int speed);

void loop()
delay (5000);

void runspeed(int speed)
int i;
for (i=100; i< speed; i++)
tone(12, i/2, 200);
tone(12, speed/2, 20000);
delay (2000);
for (i=speed; i>100; i--)

tone(12, i/2, 2000);

You have no #include statement, to include your library.

I have included it like library, by the IDE's menu ... import libray, the same as for other libraries, but it does not work while the other libraries work properly. I try also to include it in the .ino file, but whitout results. It seems the IDE does not complie my libray file .cpp. Maybe there is same wrong or miss.

Thanks and Regards,

Please post code that proves you have:

#include <Tone.h>

in it.