Skip to content

Allow libraries to be loaded from sketch / project folder #4936

Closed
@vespakoen

Description

@vespakoen

Hey!

This is an issue that must have wasted hours for many people, as some sources on the internet hint that there is a possibility to do it but it's actually not.

What is possible now:

  • Add libraries to arduino's libraries folder (ARDUINO/lib/targets/libraries)
  • NEW (as we can read here) Add libraries to ~/Documents/Arduino/libraries/ or My Documents\Arduino\libraries depending on your OS, actually after installing Arduino (using the built in install.sh on linux) it made an Arduino folder in my home directory, (~/Arduino) so, I should make a libraries folder in there?
  • Add libraries to project directory, this seems to be the best "hack" but makes it very hard to find the actual application code.

What we all want

~/MyProject
~/MyProject/libraries/Fat16/Fat16.cpp
~/MyProject/libraries/Fat16/Fat16.h
...long list of other support files...
~/MyProject/MyProject.ino
~/MyProject/FileActuallyRelatedToTheProject.cpp

This doesn't seem to be possible without a (big ass) Makefile.

The problem with the current options:

  • If I want to distribute my code, I have to add a install section that tells my users where to get and how to install libraries.
  • If changes have to be made to libraries (to manually tree-shake as space is sometimes limited, anyone?) users have to determine the location of the libraries folder based on their arduino version and OS, download the modified libraries and put them into the correct folder.
  • If 2 packages have a filename that collides, I have to move libraries out of the way and back when I need them again
  • If I want to use 2 different versions of a library for different projects, what do I do?

Is there really no way we can have relative includes at the moment?

If not, please allow it or at the very least check if there is a libraries folder inside of the sketch / project directory and link those correctly

Pains

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions