Issue - #include <Wire.h> from .cpp

I am writing a library and have the following code in a .cpp file:

#include <Wire.h>

When trying to use the Wire library, I get the following error message:

error: Wire.h: No such file or directory In member function 'void wii_nunchuck::initialize()':

This source code file and its header file are part of my sketch (Sketch -> Add File) and is in the same directory as other sketch files that are able to successfully use Wire.h. The code compiles cleanly if I do not include Wire.h and do not use its classes.

Any idea what could be happening here?

You'll also need to #include <Wire.h> in your main sketch file. Right now, there's no detection done of dependencies between libraries, so the Wire/ directory isn't on the include search path when your library is being built.

Wow, THANKS! This has been driving me crazy for quite a while now. I greatly appreciate the help! Is this on the list to be worked on?

Yes.