Hello,
I am trying to understand how the contributed libraries are installed and discovered by the build process. I am using IDE 1.6.11 on Windows 7 Enterprise.
When I install from the Arduino Library Manager, the folders appear in folder C:\Arduino\libraries. However, the documentation (https://www.arduino.cc/en/Guide/Libraries) says that libraries get installed in the user folder Documents\Arduino\libraries
Which should it be? Is there a specific search order? Is there a configuration file that lists the folders?
Longer explanation: The Arduino IDE is set up in a student lab where we use Proteus (Labcenter.co.uk) to design hardware that includes Arduino and compatibles. Proteus "reaches in" to the Arduino installation for the compilers and libraries. Specifically, I assigned a student project that includes the DS18B20 temperature sensor and requires the libraries OneWire and DallasTemperature. Of course, my demo example worked fine but the Proteus based build errors out because it can't find the libraries.
Libraries are installed to the libraries subfolder of the sketchbook folder. The sketchbook folder location is set at File > Preferences > Sketchbook location. My Documents\Arduino\libraries is the default sketchbook location on Windows but you can change it to anything you like.
LouisBertrand:
Is there a specific search order?
Yes, it's pretty complex but in general the libraries installed to the sketchbook precedence have priority over libraries installed to other locations. Exceptions to this may be if the architectures value set in library.properties doesn't match the architecture or the selected board or if the included file name doesn't match the library file name. I attempted to document the include priorities a while back here:
I think there are a couple small errors and maybe some minor changes have happened in the IDE since then. I've been meaning to work on it more and document it elsewhere but it's really a hassle to work it out by trial and error, much better if the developers would just make the effort to write some documentation instead.
LouisBertrand:
Is there a configuration file that lists the folders?
No, but I have listed the general categories at the link I posted above.