argh library not found!??

I’m building a robot for school and need to control a servo with the arduino

I followed the instructions on this page:
http://www.arduino.cc/playground/ComponentLib/Servo
downloaded and unpacked to lib/targets/libraries like they said to

even with just the one importing line of code “#include <Servo.h>”, it doesnt want to compile. I get “19: error: Servo.h: No such file or directory”

any ideas?

thanks!!

alright I think I have a different problem now…

I tried the full path instead and it found it:
#include <C:\Program Files\arduino-0010\lib\targets\libraries\Servo.h>

but now it says theres a problem with “Servo servo1;”…error:
o: In function __static_initialization_and_destruction_0': undefined reference to Servo::Servo()‘o: In function setup': o: In function main’:

this is what the example has so idk what could be wrong. I also have a setup method:
void setup()
{
servo1.attach(9);

}

and that’s all the code

Hello.

It looks like you might have put the library files in the wrong place. Try putting the various library files in a directory called servo, and put that directory in targets\libraries.

If that doesn't work, try putting the servo directory in the directory hardware/libraries and restarting your Arduino IDE.

I'm not sure which directory is the right one (or if they're both supposed to work), but I know the "hacking" instructions for creating your own library say to put it in hardware/libraries, and so far that's worked great for me.

  • Ben