I’m having an issue where the IDE / compiler can’t find included libraries when using
ATtiny boards (ATtiny85)
For example the following sketch (Bare minimum)
#include <LiquidCrystal.h>
#include <Wire.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Results in the following compiler error:
/Users/********/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_TINYX5 -DARDUINO_ARCH_AVR -I/Users/********/Library/Arduino15/packages/tiny/hardware/avr/1.0.6/cores/tiny /var/folders/nl/xzgr8cmj15g7g71x29xbz99w0000gn/T/arduino_build_435223/sketch/BareMinimum.ino.cpp -o /dev/null
/Users/********/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_TINYX5 -DARDUINO_ARCH_AVR -I/Users/********/Library/Arduino15/packages/tiny/hardware/avr/1.0.6/cores/tiny -I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src /var/folders/nl/xzgr8cmj15g7g71x29xbz99w0000gn/T/arduino_build_435223/sketch/BareMinimum.ino.cpp -o /dev/null
BareMinimum:2:18: error: Wire.h: No such file or directory
#include <Wire.h>
^
compilation terminated.
My added libraries (libraries in sketch_folder/libraries) work just fine. If I comment out “#include <Wire.h>” it compiles just fine.
Some background.
- Arduino IDE 1.8.8.
- Mac OS 10.14.2 (I only noticed this error after upgrading to Mojave)
- My sketch folder is on a different hard drive from the Arduino app. I can’t see how this is related, but want to mention it.
- I have deleted and re-installed both the ATtiny boards as well as the Arduino program. As well as verified the included libraries file path (Arduino.app > show package contents > etc.).
- I do not have this issue if I select a “standard” Arduino board (Uno, Due, etc.).
I know for a fact that I did not have this issue the previous time I tried to used the ATtiny boards (I think before upgrading to Mac OS Mojave). I only discovered this issue when I tried to update the code for a project I did months ago (at which point I had no issues using the default libraries).
I guess I don’t fully understand how Arduino handles externally installed boards / libraries. Does this issue fall on the ATtiny board developer? Or am I (hopefully) missing something obvious?
Thanks for your help.