How Sloeber selects/uses Libraries #1548
jantje
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At compile time Sloeber uses the libraries that are in the libraries folder. You can add and remove libraries there via the menu "add libraries to project" or let Sloeber manage the content of the folder (default behaviour) or a mix of the 2 (For instance by manually adding the ones Sloeber does not add automatically).
You can allow Sloeber to import libraries in your project in the workspace preferences (default on)
What triggers the library search
Sloeber subscribes on indexer updates with CDT.
When CDT informs Sloeber of indexer updates Sloeber queries the CDT indexer for "unresolved includes". (You can list the unresolved includes in Sloeber by right clicking on the project->indexer...)
CDT reports unresolved includes as header files, assume one of the unresolved includes is "xx.h". Based on the CDT provided "xx.h" Sloeber will search for the library with the name"xx". Sloeber assumes the library name "xx" to be the folder name containing the library code. Therefore Sloeber will search for a folder named "xx" in any of the provided places to look for libraries.
notes:
Here are the rules when automatically importing libraries to project in the libraries folder.
Note that "the find the library" is different implementation then Arduino IDE.
Therefore a successful "install missing library" may not lead to a find the library to "add to project" nor to a resolvement of the unresolved include.
Manually importing libraries to a project
Sloeber first searches all possible libraries to be added. Libraries are named based on the folder name containing the Library code.
In case of naming conflicts (that is 2 libraries having the same (folder)name the library that will be added to the project will be first found in the list below
As you can See Sloeber manages the libraries folder in the Sloeber project. The only modification in the libraries folder is the deletion of a library or the libraries folder itself.
Do not add libraries yourself as that will result in a non functioning setup as the include paths need to be updated as well.
Beta Was this translation helpful? Give feedback.
All reactions