0

How do you install an Arduino library so it's only available for a specific project?

Say I have a codebase located at /myproject, and I want to install libraries at /myproject/lib/somelib. I can't find how to make arduino myproject.ino find the libraries under ./lib.

Googling "installing Arduino libraries" only finds me examples of installing libraries globally (and through the GUI no less), which is horrible practice and guarantees version conflicts.

When I used ino, it supported a local ./lib directory, but I can't find any equivalent feature in arduino.

  • I don't think you can "install a library for a single project". A workaround is to simply copy all the header and source files of the library into the sketch folder, as if they were other source files. – frarugi87 Nov 30 '15 at 9:18
  • Doesn't #include lib/somelib/libheader.h work? – Gerben Nov 30 '15 at 13:56
  • @Gerben, Not for me. Arduino only seems to be able to find includes in the current directory or in one of the expected system library paths. – Cerin Nov 30 '15 at 16:23
1

I ended up switching to ano, which supports a local lib directory.

0

You want to switch to my UECIDE for that functionality. You can then place libraries inside a folder called libraries in your sketch folder.

You also get the benefits of a much improved IDE :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.