HELP I'm sinking in the library morass. My program can't file #include <ESPAsyncWebServer.h> even though I can visual see it in
C:\USERS*\Downloads\Documents\Arduino\Sketchbook\libraries
I am somewhat mistified as to what libarary to use:
C:\USERS*\Downloads\Documents\Arduino\Sketchbook\libraries
C:\USERS*\Downloads\Documents\Arduino\libraries
C:\USERS*\AppData\Local\Arduino15\Packages\arduino\hardware\avr\1.8.6\libraries
or one of the MANY others.
I am using IDE ver 1.8.6 on Windows 10, no going to ver 2.x is not the answer.
and yes it can find other includes ahead of this one.
I know this subject has been brought up many time but with different answers every time. The simple answer of going to Sketch>Include Library is NOT the answer.
What is the location of your Sketchbook ?
The reason for asking is that most libraries will be in a folder named libraries within the Sketchbook folder, but there are exceptions
I am using a ESP32 board.
I sketchbook location is
C:
Users
xxxxx
Documents
Arduino
Sketchbook
Yes, this is the location specified in the Preference location
The standard location for general purpose libraries is, as I said, in folders within the libraries folder of your Sketchbook location as specified in Preferences
The compiler will look there for libraries installed by the user. This is best done by using the Library Manager but you can do it manually by creating a folder for the library and putting the library files within it
The compiler will be blissfully unaware of and other location that you have put library files in, such as C:\USERS\Downloads\Documents\Arduino\Sketchbook\libraries
Now for the more confusing bit of library location. Some libraries only work with particular processors, so how does the compiler know where to find them and which to use, bearing in mind that there may be multiple libraries with the same name but with different target processors ?
This is where folders such as C:\Users\Bob2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries come into play. This, for instance, is where libraries specific to to AVR processors are located. If you install the board files for the Uno R4, which uses a Renesas processor, then the installation will create a libraries folder specifically for the libraries specific to that processor named C:\Users\Bob2\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.4\libraries
If possible you should use the Library Manager to install libraries as that should ensure that the library files are put in the correct location, either for general use or for use with specific processors. The compilation process will take care of looking in the right place for the specified library, first in the sketch folder if you use the #include "LibraryName.h" form of #include, then in the processor specific library folder then in the general libraries folder
Thanks UKHeilBob
The answer is their is a folder in the Arduino director (the same directory as the sketchbook) called library. This is where all library should be. The IDE may find libraries elsewhere but it un-reliable. I have experimented and move ALL libraries to the correct location. Their was some confusion on the IDE part at first, but if the library was in the correct spot it worked.