Problems with unused libraries

I have a strange problem with a library that I am NOT using

Here’s the situation. I have library “WiseClock2” that is in the “libraries” folder inside of the “sketches” folder as per the v0018 setup. (this is on a Mac)
I have one sketch that uses said library and has a line in it
#include <Wire.h>
Sketch #1 works fine.

Today I wrote a new sketch, grand total 15 lines of code and it does NOT use the “wise” library.

I get the following error

/Arduino/sketches/libraries/WiseClock2/DS1307.cpp:10:18: error: Wire.h: No such file or directory

This is one of the files in the Wise library that I am NOT using. In my opinion it should not even be compiled, but thats the way Arduino works, it compiles everything.

Now this sketch does NOT use ANY of these libraries, in fact, the ONLY thing it uses is HardwareSerial.

If, in this new sketch I put the line
#include “Wire.h”

Then the library compiles fine. Even though I am NOT USING THE LIBRARY.

I get the same results no mater what board type I select.

Any ideas?

What other libs are you using? Could on of those be referencing the Wire.h lib?

Mark, since your DS1307.cpp file uses wire, it would make sense for it to have the ‘#include’ in it, or to put it in the library’s .h file.

I’d also try putting it as #include <wire.h> rather than “wire.h”, but that might not make any difference.

You sketch must #inlcude all the files used by the libraries you use, otherwise the libraries' .h files can't find the other libraries' .h files.