(my very first post)
Ok,
I am very new and I apologize ahead of time if I breach any protocols. I purchased an Arduino UNO A few weeks ago and started learning from scratch. I successfully developed several projects utilizing different LCD displays and the I2C interface. Today there was an update to the IDE available and I OK'd the update. Now none of my previously working projects will compile. Something about missing the Wire.h file. I read about many Wire.h issues and that didn't help me. I tried to use "#include <Wire.h>" but that doesn't work either. Strangely, when I try to load any of the I2C examples built in to IDE, they do not load, nothing happens. Other examples load fine.
I tried uninstalling Arduino IDE and re-installing to no avail. Remember, I've only been at this for a few weeks. Here is a copy of my error message:
C:\Users\jimfa\OneDrive\Documents\Arduino\Garage temp\Garage temp.ino:2:10: fatal error: Wire.h: No such file or directory #include <Wire.h>
^~~~~~~~
compilation terminated.
exit status 1
Compilation error: Wire.h: No such file or directory
Any help will be appreciated
Windows 10 professional 64 bit
For some reason it is looking in your project directory for that library and it’s not there . I’m not sure but there maybe issues if having it in that drive .
Check your preferences and/or download it from git hub .
There may be other reasons that someone can help with , I’m still on 1.8 waiting for the dust to settle .
Other questions
How did you install it - what steps ?
Where did you get your version 2 from ?
Hi Hammy,
I originally installed it from : "https://www.arduino.cc/en/software" only a few weeks ago, then yesterday it prompted me to update to 2.0.2, i just hit "OK". When all of my sketches failed, i uninstalled 2.0.2 and reinstalled from the above link.
It seems that my issue may be this OneDrive thing. I tried to divorce all Arduino operations from all OneDrive activities, but I still have the Wire.h issue. I made a sketch with ONLY "#include <Wire.h>" and still get the missing file error
D:\Arduino\My Sketches\Empty sketch\Empty sketch.ino:2:10: fatal error: Wire.h: No such file or directory #include <Wire.h>
^~~~~~~~
compilation terminated.
exit status 1
Compilation error: Wire.h: No such file or directory
Do you know where the hidden "arduino15" folder is ?
If you compile it for a Arduino Uno, then it will take the Wire library from there: arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/Wire.cpp
Try with a sketch that is located on your computer, and check if you see that path for "Wire.cpp" in the verbose compiler output.
Thank you Koepel,
Ok, I found Wire.cpp and Wire.h in the path you mentioned. I created an empty sketch with only "#include <Wire.h>" and here is the returned Verbose output though I'm sure I don't understand it yet:
Using board 'uno' from platform in folder: C:\Users\jimfa\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\jimfa\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
D:\Arduino\My Sketches\Empty sketch\Empty sketch.ino:2:10: fatal error: Wire.h: No such file or directory #include <Wire.h>
^~~~~~~~
compilation terminated.
"C:\Users\jimfa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\jimfa\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\jimfa\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "C:\Users\jimfa\AppData\Local\Temp\arduino-sketch-8156F2E02A198C4688B77F87FD62DC76\sketch\Empty sketch.ino.cpp" -o nul
Alternatives for Wire.h: []
ResolveLibrary(Wire.h)
-> candidates: []
exit status 1
Compilation error: Wire.h: No such file or directory
The error occurs when the Arduino build tools are trying to detect the needed libraries. It looks like when it goes to resolve the libraries it needs, it doesn't know about the Wire library for the 'uno' board / 'arduino' core combo for some reason. Have you tried uninstalling the AVR board support package and re-installing it from within the Boards Manager?