Closed
Description
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/
orMy Documents\Arduino\libraries
depending on your OS, actually after installing Arduino (using the built in install.sh on linux) it made anArduino
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
- http://arduino.stackexchange.com/questions/8651/loading-local-libraries
- http://stackoverflow.com/questions/14413372/creating-libraries-in-arduino-sketch-folder?s=1|0.4971
- http://stackoverflow.com/questions/4705790/keeping-all-libraries-in-the-arduino-sketch-directory?s=3|0.3257
- http://stackoverflow.com/questions/20413851/git-combining-multiple-repos
- http://stackoverflow.com/questions/7422841/using-arduino-ethernet-h-under-eclipse
- The list goes on, more here: http://arduino.stackexchange.com/search?q=libraries+sketch
- On the forum: https://www.google.com/search?q=arduino+libraries+subdirectory+site:forum.arduino.cc