Skip to content

Manage non-standard libraries

The libraries should comply with the Arduino IDE 1.5: Library specification .

Include non-standard folders

However, some libraries do not follow the Layout of folders and files from the official Arduino library specification.

This may raise issues during compilation.

Example

The TFT_eSPI library includes header and code files in all those sub-folders.

TFT_eSPI/
├── docs
│   ├── ESP32 UNO board mod
│   ├── ESP-IDF
│   ├── PlatformIO
│   └── RPi_TFT_connections
├── examples
│   ├── 160 x 128
│   ├── 320 x 240
│   ├── 480 x 320
│   ├── DMA test
│   ├── ePaper
│   ├── Generic
│   ├── GUI Widgets
│   ├── PNG Images
│   ├── Smooth Fonts
│   ├── Smooth Graphics
│   ├── Sprite
│   └── Test and diagnostics
├── Extensions
├── Fonts
│   ├── Custom
│   ├── GFXFF
│   └── TrueType
├── Processors
├── TFT_Drivers
├── Tools
│   ├── bmp2array4bit
│   ├── Create_Smooth_Font
│   └── Screenshot_client
└── User_Setups
  • List all the sub-folders after USER_LIBS_LIST.

Example

USER_LIBS_LIST = ​TFT_eSPI TFT_eSPI/Extensions TFT_eSPI/Fonts TFT_eSPI/Fonts/Custom TFT_eSPI/Fonts/GFXFF TFT_eSPI/Fonts/TrueType TFT_eSPI/TFT_Drivers

Exclude non-standard folders

Some libraries include additional folders and files which are not related with the Wiring / Arduino project and may interfere with the compilation.

Example

The ArduinoJSON library contains the usual folders src and examples, which are consistent with the Arduino IDE 1.5 Library Specification .

ArduinoJson/
├── examples
│   ├── JsonConfigFile
│   ├── JsonFilterExample
│   ├── JsonGeneratorExample
│   ├── JsonHttpClient
│   ├── JsonParserExample
│   ├── JsonServer
│   ├── JsonUdpBeacon
│   ├── MsgPackParser
│   ├── ProgmemExample
│   └── StringExample
├── fuzzing
├── scripts
├── third-party
├── tests
└── src
    └── ArduinoJson

However, the same library also contains the additional folders fuzzing, scripts, third-party and test, which may interfere with the normal compilation.

On a more recent version of this library, the non-standard folders have migrated under the extras folder.

As a solution,

  • Zip the non-standard folders.

  • Remove them.

  • Create a new sub-folder extras and move the non-standard folders inside.

Exclude libraries

Some libraries are specific to a platform but are included in a folder shared with other platforms, and some libraries may conflict with other ones.

  • Edit the main Makefile and edit the variable EXCLUDE_LIBS with the libraries to be excluded.

Example

The WiFi library included among the core libraries is solely designed for the Arduino WiFi Shield.

With the Arduino 1.0 and 1.5 IDE, the WiFi is included by default in the compilation process, and raises error and warning messages even with the official IDE.

To exclude the WiFi library and avoid any unnecessary error,

  • Mention its name WiFi after the variable EXCLUDE_LIBS.
# List the libraries to be excluded
# For example, WiFi may crash on Arduino 1.0.2
#
EXCLUDE_LIBS = WiFi

To use all the libraries,

  • Leave the line empty after the EXCLUDE_LIBS variable.
EXCLUDE_LIBS =

By default, the EXCLUDE_LIBS is empty and the line has a leading # to comment it.

The parameter impacts all libraries, core, application, user and local.