Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Arduino Library Management With Symlinks(How is the library directory implemented, and is there a way to make the Arduino plugin access external libraries with symbolic links?)
Arduino Library Management With Symlinks [message #1775041] Tue, 24 October 2017 02:39
Isaac Rex is currently offline Isaac RexFriend
Messages: 1
Registered: October 2017
Junior Member
I have recently decided that I want to start developing for Arduino in a more complete IDE. I use Eclipse for my college Java class, and I have grown rather fond of it. I am using the CDT Arduino plugin, but I have a problem with managing my Arduino libraries. What I would ultimately like to do is maintain one libraries folder in my Arduino directory, and have Eclipse link to that same folder.

The Arduino plugin for Eclipse keeps its libraries in ~/.arduinocdt/libraries/, so I had the idea of creating a symbolic link in ~/.arduinocdt/ named "libraries" and linking it to my Arduino libraries directory. This does not work. Eclipse simply won't load the libraries if they're in the form of a symbolic link. I did find that it works if I hard link /Arduino/libraries/ to ~/.arduinocdt/libraries/, but it seems that hard linking directories is generally discouraged, and I would like to avoid this solution.

So my question is simply, is this possible? Can I maintain my libraries in /Arduino/libraries/ and have Eclipse refer to that folder? A solution that does work is to keep my "real" libraries folder in ~/.arduinocdt/libraries/ and symlink to that directory in /Arduino/libraries/ (the Arduino IDE is perfectly happy using a symlink) but I would really like to go the other way.

How To Use Custom or External Libraries
This is a decidedly unintuitive process, and there seems to be a lot of confusion on how to do it, so I thought I would share what worked for me.

I mentioned above that the Arduino Eclipse plugin keeps its libraries in ~/.arduinocdt/libraries/ (on Mac). Adding a library is almost as simple as copying the library folder in to that directory, just as you would for the Arduino IDE (if you have no libraries installed already, you will need to make the "libraries" folder).

The one extra thing you need is a "" file inside your library's folder. I've included the one I used for my Debounce library bellow to use as a template. Your final path should look something like ~/.arduinocdt/libraries/yourLibrary/ and inside this directory you will have your .h, .cpp,, and anything else your specific library may depend on.

Once you have your library in this directory, restart Eclipse and it should show up in the Arduino Downloads Manger. From here, you add them to your project as if they were a library you downloaded from the manager.

This is (more or less) what the contents of the file should look like. You can create it with any text editor.
sentence=Simple library to handle button debouncing
paragraph=This library supports debouncing of any number of buttons
category=Mechanical Input
Previous Topic:external library update always requires re-indexing
Next Topic:make: *** [demo/ws2811_controller.o] Error -1073741502
Goto Forum:

Current Time: Mon Jun 25 14:12:20 GMT 2018

Powered by FUDForum. Page generated in 0.01787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top