I created some libraries that defines types to be used in several sketches.
I read the guide http://arduino.cc/en/Hacking/LibraryTutorial but it tells to locate the libraries files in a subdirectory named libraries in the sketch directory.
In order to avoid copying my libraries all over the different sketches, is there a way to put it in one place and make them visible to all sketches ?
In order to avoid copying my libraries all over the different sketches, is there a way to put it in one place and make them visible to all sketches ?
Do what the guide says.
locate the libraries files in a subdirectory named libraries in the sketch directory.
In this context "the sketch directory" does not mean the directory that the individual sketch is in but the generic Sketchbook directory in which all sketches are filed. Look at the Sketchbook location in File/Preferences in the IDE.
I prefer to keep that sort of code in the directory with the program that uses it because then I never have to worry about the code and the "library" getting separated - either physically or temporally (such as when the library is updated without checking backward compatibility).
And if you want to give the program code to someone else all of the dependencies can go with it apart from those provided by the standard Arduino system that everyone has.
The extra "cost" in terms of using up hard disk space is neligible.