B4R Question is there an overview about library folders?

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
Hi, after reinstalling I had some problems to difference library folders. there is

1. C:\Program Files (x86)\Arduino\libraries
2. C:\Program Files (x86)\Anywhere Software\B4R\Libraries
3. additional libraries

first: I would like to understand, which ones are overwritten by installationes and which one I can use for own libraries, that have been changed by myself?

secondly: is there a priority in compilation that prefers library folders, if there are same named libraries in different folders? Which one would be copied to sketch folder?

third: do some libraries necessarily concern to special folders, or can they be copied to other folders?

great thanks
 

Daestrum

Expert
Licensed User
Longtime User
As far as I understand

Files in .../B4R/Libraries will/may get overwritten on (re)installation of B4R.
Files in .../Arduino/Libraries get affected by downloading/updating libraries in the Arduino IDE.
Files in .../additional libraries get affected by you writing new wrappers or (possibly) downloading user written wrappers/libraries from the forum.

Priority order can depend simply on use of <...> or "..." in the include statement (<..> Arduino path first then other locations, "..." current path then other locations).
(If you rewrite a wrapper/library probably safest to change it's name slightly).

An example for layout of library folder (from a wrapper I wrote)
[additional libraries}
rGDB.xml <- the xml file of the library
[rGDB} <- folder for the wrapper
rGDB/rGDB.cpp <- the code of the wrapper (could be multiple .cpp files)
rGDB/rGDB.h <- header file. (one per .cpp file)

Obviously there are lots of xml files and other folders in the additional libraries but all follow the same format.

Hope this helps (and doesn't make it more confusing).
 
Upvote 0

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
... may I have some more questiones? If there is a wrapped library, do I still need the original? ( for instance: if I use rAdafruitNeoPixel.h, do I still need AdafruitNeoPixel.h then?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Simple answer is yes - most wrappers simply include the original library by calling include<...> or include "..." and provide calls to the original library.
It's the wrapper that is used to create the .xml file that allows the IDE to know what functions (and parameters) are callable from the library.
 
Upvote 0

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
... so it's necessary, to keep them in folder. If I use regulary wrapped libraries (..not inline), I guess, they only will be taken from Anywhere folder and additional folder. Is there a priority too? Should wrapped libs be deleted in Anywhere folder, if I prefere own ones in additional folder?
 
Upvote 0

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
fortunately, i could reset to a working constellation. Will make some raid1 copies now an then install step for step to see, while DFPlayer_mini lib not could be compiled...
 
Upvote 0
Top