0

Why has Adafruit ImageReader Library v2.3.5 recently added six dependencies on other libraries for hardware I'm not using?

I used the v2.3.2 of the Adafruit ImageReader Library successfully two months ago. An example sketch worked fine with my ILI9341 3.2" display and its SD card.

Now there is an updated v2.3.5 available but the library manager wants to add six more "dependency" libraries: - Adafruit ST7735 and ST7789 Library - Adafruit seeswaw Library - Adafruit HX8357 Library - Adafruit SSD1351 library - Adafruit SSD1331 OLED Driver Library for Arduino - Adafruit EPD

As far as I know, the ILI9341 uses none of the hardware that corresponds to the six libraries it's trying to drag in. I don't want unneeded dependencies and don't want the code bloat.

If I don't accept the additional libraries, my sketch fails to compile. The error message is "C:\Users\barry\Documents\Arduino\libraries\Adafruit_ImageReader_Library\Adafruit_ImageReader_EPD.h:18:10: fatal error: Adafruit_EPD.h: No such file or directory"

However, EPD code is for "e-paper displays" which does not apply to my ILI9341 which is a TFT display. I don't think EPD code should be a real dependency.

Kindly redirect me if there's a better place to ask.

0

If you don't use the functions of the ImageReader library, which use the additional libraries, your compiled code will not contain code from the additional libraries.

The Adafruit ImageReader library may have functions which use other libraries and the libraries are required for compilation. But at linking the compiled units which are not used by your code and even parts of the compiled units which are not used by your code are not put in the resulting hex or bin file.

| improve this answer | |
  • I sincerely hope that the linker is smart enough to leave out compiled units that are not used. However, linkers can only operate upon external references between components and is not able to detect run-time usage. – Barry Dec 29 '19 at 13:47
  • So in my case, if the ImageReader library has a "new EPD()" statement anywhere (I don't know if it does or not), such that the instantiation occurs at run-time, the linker must include the EPD library code, regardless of if it's ever actually called or not, right? Bottom line, I think I need to get a clean compile, find the .elf file, and generate a memory map to see what components are included. Thanks! – Barry Dec 29 '19 at 14:00
  • yes there are things where the compiler can't evaluate the dependencies (like virtual methods of classes), but the new EPD() is not one of them. here it is clear at compile time that the class EPD will be used. – Juraj Dec 29 '19 at 14:08
  • I hope to get an answer to the original question "Why has Adafruit ImageReader Library v2.3.5 recently added six dependencies on other libraries for hardware I'm not using?" On GitHub, the library description only says "Requires Adafruit_GFX library and one of the SPI color graphic display libraries, e.g. Adafruit_ILI9341." However the current version depends on six additional libraries for other hardware. link – Barry Dec 30 '19 at 16:38
  • @Barry, the reason is CI tests of examples groups.google.com/a/arduino.cc/forum/#!topic/developers/… – Juraj Dec 30 '19 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.