I am trying to use the Arduino CLI to compile a .ino file with a library in it (SR04). I have the library installed in both my Documents folder as well as in the Arduino15 folder. I installed the library with both the IDE and the arduino CLI. When I go to compile it, with arduino-cli compile --fqbn arduino:avr:uno Autonomous_car.ino, I get
Autonomous_car.ino:1:10: fatal error: SR04.h: No such file or directory
#include <SR04.h>
^~~~~~~~
compilation terminated.
Error during build: exit status 1
I am using the Arduino CLI downloaded through homebrew.
I have a Mac, Guess I should have specified that. It is in my /Users/MyName/Documents/Arduino/libraries. I also have one in the /Users/MyName/Library/Arduino15/staging/libraries folder
Libraries should be installed under the libraries subfolder of the folder specified via Arduino CLI's directories.user configuration key. You can find the location of that user directory (the equivalent of the Arduino IDE's sketchbook folder) by running this command:
/Users/MyName/Library/Arduino15/staging is directories.downloads.
This is the location the archives of libraries and boards platforms (AKA "cores") are staged at during the Library Manager (e.g., arduino-cli lib install) or Boards Manager (e.g., arduino-cli core install) updates.