Issues with mysterious library behavior ...

Hi there, I created my own Arduino library a while ago and have been using it in my sketches. I initially placed it in its own folder under the libraries directory in the Arduino installation folder. All works well and the library is picked up by the editor as a "Built-in" library (which obviously it's not).

However, I decided to upgrade, which apparently blows away the libraries directory, and the library is no longer present after the upgrade. So this time I decided to place my library outside of the main Arduino installation folder, into a separate location. I also added the library from the IDE using Sketch -> Include Library. The library is now listed as "Contributed" instead of "Built-in" and everything is building again.

However, as I started modifying the library (i.e. .cpp and .h), the changes were mysteriously not picked up by the compiler, and I keep getting the old code no matter how I edit the library code.

After much troubleshooting, I found out that the IDE had somehow created a mirror of my library code under "My Documents\Arduino\libraries" without telling me, and worse yet, it started referencing the library from that location.

Worse yet, it seems like whenever I add a library outside of the "Built-in" location, it always gets copied and referenced under "My Documents\Arduino\libraries". Is there a way to stop this madness and make the IDE honor the original path where I created my libraries? I really don't want my library code sitting in "My Documents" and away from the rest of my code base.

FYI, this is happening in Arduino v.1.6.4 and I'm running on Windows. Any help will be appreciated!

Thanks, - K.

primate: After much troubleshooting, I found out that the IDE had somehow created a mirror of my library code under "My Documents\Arduino\libraries" without telling me, and worse yet, it started referencing the library from that location.

Nothing mysterious about it. That is where your library belongs. In the libraries folder in your Sketchbook. Which has been the case for years.

Ah thank you. To come think about it, I think the term "Include Library" in the menu might have let me to assume that the library was included in-place instead of being copied elsewhere and "disconnected" from the original library source location.

I think one minor suggestion is to rename the menu option to say "Import Library" instead. I think that would give the sense that the library would be imported elsewhere.

Just two cents' worth and I'm sure it's not a high-priority issue, but thanks for clearing this up!

  • K.

There is no longer a way to browse for a library in an arbitrary location so the labeling problem has essentially solved itself.