<SOLVED> Error compiling any of the Wire example sketches

If I try to load and compile any of the provided Wire Library sketches (e.g. master_write.ino), I get an error on each line of code the uses the wire library. The error I get is :

master_writer.cpp.o: In function setup': C:\Program Files\Arduino/master_writer.ino:18: undefined reference toWire' C:\Program Files\Arduino/master_writer.ino:34: undefined reference to Wire' C:\Program Files\Arduino/master_writer.ino:34: undefined reference toTwoWire::begin()'

The line in question (line 18) is :

Wire.begin(); // join i2c bus (address optional for master)

Needless to say I get the same error if I try to write my own sketch using the wire library. Has anyone successfully compiled any of the Wire Library examples?

Thanks.

I opened the master_writer example using 1.0.5, and compiled for the Arduino Uno. I got:

Binary sketch size: 2,564 bytes (of a 32,256 byte maximum)

You opened the master_writer sketch in some unknown version, and selected some unknown board. You expect us to help?

I also opened the master_writer example in arduino 1.5.4. Compiled by clicking the upload button and it compiled fine (it failed on upload as I have no arduino connected)
If you are using the arduino software click on the sketch pulldown, go to import library and check you have the wire library on your computer. (it should be the bottom one.)

I am using Arduino 1.05. I have the IDE configured for a Uno, although I tried with a Mega2560 as well and had the same problem. I have programmed and developed a fair number of commercial Arduino applications so I understand the entire development process and the IDE rather intimately (see PaulS I can be as snarky as the best of you). I was able to select the Wire library from the dropdown so I have to assume it was correctly installed on my computer. I have used most of the other standard libraries with no issues so I am not sure why the Wire library is causing a problem. I have quite a few third party libraries installed so I wonder if it is possible that I am having some sort of conflict with one of them?

I have quite a few third party libraries installed so I wonder if it is possible that I am having some sort of conflict with one of them?

That’s a possibility. Rename the libraries directory. Create a new libraries directory, empty. Try to compile the example. If it compiles, move some libraries from the renamed directory to the new libraries directory, restart the IDE, and try to compile the example again.

You’ll quickly determine whether an existing library is causing the problem.

Ok, I was able to solve the problem with a clue from another similar posting. I looked at my "Sketchbook Location" under File>Preferences and looked in the Libraries directory under that tree. It contained only a few folders (Picaso_Serial_4DLib, Kentec35_Distribution110, shiftStepper_master) whereas the Wire folder I was trying to use was in the Libraries folder in the C:\Program Files\Arduino\ tree. This is the location of the other libraries that I have successfully used such as Time, SPI, SoftwareSerial, Ethernet, etc. When I copied the Wire folder to the Sketchbook Location everything compiled and ran fine.

I will have to admit to being a bit confused as the compiler found the Wire.h file I included in its original location (when I renamed the file for testing purposes I got a "file not found" error), and all the other example sketches/libraries I tested are in this old location, so I don't really understand why the Wire library in particular had to reside in the Libraries folder under the Sketchbook Location. Ah well...

Thanks all.

I will have to admit to being a bit confused as the compiler found the Wire.h file I included in its original location (when I renamed the file for testing purposes I got a “file not found” error), and all the other example sketches/libraries I tested are in this old location, so I don’t really understand why the Wire library in particular had to reside in the Libraries folder under the Sketchbook Location. Ah well…

I’m confused, too, since my copy of Wire.h IS in the Arduino core libraries folder.