-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow libraries to be loaded from sketch / project folder #4936
Comments
It is now possible to do this. Note that the files outside the
and the include statement in MyProject.ino:
|
@per1234's solution doesn't seem to solve this issue because:
@vespakoen's points still apply, it is impossible to distribute libraries with the sketch using the official Arduino tools. With arduino-cli it is now however possible to install libraries from CLI, making it easy to install libraries from a Makefile (example). It is possible to specify library's version, installing two versions of the same library is still not possible though. |
Meh. I'm not buying it.
A little inconvenient, but I think "ugly hack" is going too far.
No. The src folder system provides exactly what vespakoen requested.
Come on. That's clearly a false statement. Perhaps it's possible to improve, but it absolutely is possible. |
I've just tried it and, while the Should have asked. You're right and I'm sorry. Btw, is this covered in any docs somewhere or one has to read the sources? |
Ah, I see now. It was my text representation of the folder structure. It indeed would be unacceptable if there was some required filename prefix. Sorry for the confusion.
No apologies necessary. I think it's possible there is a better solution to the general problem of bundling libraries with sketches. It's just that this particular feature request of vespakoen has been resolved. Other possibilities are: https://github.com/arduino/Arduino/issues/7524 This is actually less applicable to this request since it won't allow different library versions to be used. I'm not sure I completely understand that PR, but this comment shows a lot of promise. If we could add a
Unfortunately no. This is one of quite a few useful features that were never documented. I think the root problem is that there is not currently a good place to document it. I think the ideal location would be an "Arduino Sketch Specification", just as we already have for hardware packages, libraries, and Boards Manager JSON files. I brought that up in the developers mailing list some time ago but didn't get any response. I suppose I should probably just go ahead and do it and hope nobody minds. |
This comment has been minimized.
This comment has been minimized.
Is there really no standard way to include libraries in my sketch folder? This is driving me bonkers. I don't want my library relying on the setup of a specific computer. Being able to put a library folder in my sketch folder seems like an obvious solution. |
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:
ARDUINO/lib/targets/libraries
)~/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?What we all want
This doesn't seem to be possible without a (big ass) Makefile.
The problem with the current options:
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
The text was updated successfully, but these errors were encountered: