Missing library

I cannot locate https://www.arduino.cc/reference/en/libraries/adafruit-lsm303agr-mag/ lib. Do I need to ping Adafruit people to integrate the lib? Or I am missing something.

Here it says that “Adafruit LMS303AGR Mag” is the old name of the library? [Library Manager] remove Adafruit_LSM303AGR · Issue #11455 · arduino/Arduino · GitHub

It’s now called Adafruit_LIS2MDL and that is listed per PlatformIO Registry.

If in doubt, you can always

lib_deps =

to get the referenced library in that version as it appears in your linked website.

1 Like

I added new dependency but lib is not compiling.

platform = atmelavr
board = nanoatmega328new
framework = arduino
lib_deps =
adafruit/Adafruit LIS2MDL @ ^2.1.3

Building in debug mode
Archiving .pio/build/nanoatmega328new/libb5d/libhd44780.a
Compiling .pio/build/nanoatmega328new/libef6/Adafruit LIS2MDL/Adafruit_LIS2MDL.cpp.o
Indexing .pio/build/nanoatmega328new/libb5d/libhd44780.a
Compiling .pio/build/nanoatmega328new/FrameworkArduino/Print.cpp.o
Compiling .pio/build/nanoatmega328new/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/nanoatmega328new/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/nanoatmega328new/FrameworkArduino/USBCore.cpp.o
Compiling .pio/build/nanoatmega328new/FrameworkArduino/WInterrupts.c.o
.pio/libdeps/nanoatmega328new/Adafruit LIS2MDL/Adafruit_LIS2MDL.cpp:35:10: fatal error: Wire.h: No such file or directory

Is it something with dependency or my setup?

It worked when I added import to my class(that uses library) to main.cpp. Why? It looks like it tried to compile libraries that are not really imported in any of my code and couldn’t locate headers

Quirk of the Library Dependency Finder (LDF). The library you want to use has to be included in one of the cpp files at least for the LDF to recognize all its dependencies.