Servo.cpp - multiple definition of `Servo::Servo()'

Has anyone had problems with the Servo library showing a "multiple definition error?

I tried both example programs, Sweep and Knob, and I get:

avr\Servo.cpp.o: In function `Servo':
C:\Program Files (x86)\Arduino\libraries\Servo\arch\avr/Servo.cpp:220: multiple definition of `Servo::Servo()'
src\Servo.cpp.o:C:\Program Files (x86)\Arduino\libraries\Servo\src/Servo.cpp:235: first defined here
avr\Servo.cpp.o: In function `Servo':
C:\Program Files (x86)\Arduino\libraries\Servo\arch\avr/Servo.cpp:220: multiple definition of `ServoCount'
src\Servo.cpp.o:C:\Program Files (x86)\Arduino\libraries\Servo\src/Servo.cpp:235: first defined here
avr\Servo.cpp.o: In function `Servo':

Both examples compiled for me: Arduino 1.5.5; Arduino Uno selected.

Both compile on IDE 1.05 here.
(windows 7)

Interesting. I tried downloading 1.55, and copied the Servo library over to my libraries directory. Still fails the same way.

I do notice one interesting thing, though, I got two tabs showing up in the IDE. Both said "Sweep". I see that there were two Sweep programs in the examples\Sweep directory, Sweep.ino and Sweep.pde. Figuring this was a possible cause, I deleted Sweep.pde, and now I get an error "Servo does not declare a type.

I get the feeling that my Servo library may not be right.

The contents of libraries\Servo are as follows:

arch
   avr
      Servo.cpp
      ServoTimers.h
   sam
      Servo.cpp
      ServoTimers.h
examples
   Knob
      Knob.ino
      Knob.pde
   Sweep
      Sweep.ino   
      Sweep.pde
src
   Servo.cpp
   Servo.h
keyword.txt
library.properties
Servo.h

Anyone see anything wrong with it?

lar3ry:
...copied the Servo library over to my libraries directory.

Why?

Because I thought perhaps the one I had was corrupted, and you said it compiled under 1.55
I probably should have mentioned that I replaced the one I had with the one from the 1.55 release.

lar3ry:
Because I thought perhaps the one I had was corrupted...

The Servo library you had under the Sketchbook/libraries folder? Why do you have a copy of the Servo library under the Sketchbook/libraries folder?

?
I'm trying to figure out why you would think I have it in my Sketchbook directory. It's in C:\Program Files (x86)\Arduino\libraries

Reply #3...

...and copied the Servo library over to my libraries directory.

Exactly. No mention of Sketchbook.

Any ideas? Is your Servo library laid out that way?

lar3ry:
Exactly. No mention of Sketchbook.

Then where is the "my libraries directory"?

I told you in post #7.

"my libraries" is not the name of the directory, but it is my libraries directory. ie. it is not your libraries directory, and in fact, it's the only libraries directory I use when I am programming the Arduino.

I would ask again if your Servo library directory is laid out the same, but it doesn't seem like it will do any good.

\libraries\Servo\arch
\libraries\Servo\examples
\libraries\Servo\keywords.txt
\libraries\Servo\library.properties
\libraries\Servo\src
\libraries\Servo\arch\avr
\libraries\Servo\arch\sam
\libraries\Servo\arch\avr\Servo.cpp
\libraries\Servo\arch\avr\ServoTimers.h
\libraries\Servo\arch\sam\Servo.cpp
\libraries\Servo\arch\sam\ServoTimers.h
\libraries\Servo\examples\Knob
\libraries\Servo\examples\Sweep
\libraries\Servo\examples\Knob\Knob.ino
\libraries\Servo\examples\Sweep\Sweep.ino
\libraries\Servo\src\Servo.h

Thank you!

It seems that I have an extra Servo.h, and Servo.cpp The two Servo.h files were of different sizes.

Got it compiling.