Really bad Library problem

I installed the "arduino-ide_2.3.10_Windows_64bit.exe" to "C:\Users\tonyA\AppData\Local\Programs\Arduino IDE".
I have this directory: "C:\Users\tonyA\Documents\Arduino"
This is where the libraries are: "C:\Users\tonyA\Documents\Arduino\libraries"

I am working on this sketch: "C:\Users\tonyA\Documents\Arduino\ESP32_ESP_NOW_Weather_Receiver_Server_V8"

My library list is:

#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <NTPClient.h>
#include <esp_now.h>
#include <WiFi.h>
#include <WiFiUdp.h>
#include <Wire.h>
#include "FS.h"
#include "SD.h"
#include <SPI.h>
#include <string.h>
#include <Arduino_JSON.h>
#include <LiquidCrystal_I2C.h>

Whenever I Verify my sketch, many of the libraries can't be found and I have to REMOVE them, and then REINSTALL them.

Also, I get an error message that searches for a library in a completely different directory that isn't in my sketch's directory. This causes the Verify to fail every time, and I can't get my sketch to work and Upload.

I'm really confused about these library problems.
Where do the libraries go? In "C:\Users\tonyA\Documents\Arduino\libraries"?

How can I fix this?
Do I change the #includes from #include <AsyncTCP.h> to #include "AsyncTCP.h"?
Thanks?

Have a read of the link below , which might help . The error suggest the IDE can’t find the library folder and its relation to the project folder .

Link

System includes should be <>, "" is for your own includes.

The build process for Arduino is a bit complex and unlike anything I have used before. That means you will see what look like errors caused by looking in a different directory, but it is not unexpected.
The libraries folder/dir goes under whatever you have specified in this

That link shows one example, my Arduino folder is 4 levels down . All that matters is that libraries is under or in the arduino sketchbook (same place different words) see post 4 for the other half.

Post the entire sketch in code tags so others can try the verify.

Here are two ways

I tried to find that sketch but could not.

What is the sketchbook directory. If it does not point to "C:\Users\tonyA\Documents\Arduino" that will be the cause of your problem. Check this under File → Preferences.

Referring to this...

I have this directory: "C:\Users\tonyA\Documents\Arduino"

... and to the path you gave for the installation. Your system has cut off the the end of the path at the whitespace...

"(space)IDE"

Uninstall and reinstall without whitespace.

Right, thanks, it was the Properties with the wrong sketch location. So that got fixed. I also re-installed the libraries that were giving me problems, and at this point it's Verifying on everything except "ESPAsyncWebServer".
I'm using an older ESP32 Wrover Module so I'm getting errors like
"WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)". There's another version "AsyncEspFsWebserver" which is supposed to fix that error.
We'll go from there, or I might have to get newer ESP32 Wrover Modules.
Thanks again.

That won't fix anything, it's not a problem between newer library versions and older ESP32 modules because there are no old ESP32 modules, they have only been around a few years. If your old Wrover module was based on esp8266, then maybe.

OK, maybe you can answer this for me then.
When I install a libray in the sketch, where does it go?
I can't find a libray in the install directory:
"C:\Users\tonyA\AppData\Local\Programs\Arduino IDE"
and i can't find it in my :
"C:\Users\tonyA\Documents\Arduino\libraries"
where my sketch is.
Thanks.

I would say that is where it should get put.

Your sketch should not be in the libraries folder! How did that happen?

Ah, I found out where it was put:
"C:\Users\tonyA\Documents\Arduino\ESP32_ESP_NOW_Weather_Receiver_Server_V8\libraries"
But my sketch can't find them.
I think I should put them in the
"C:\Users\tonyA\Documents\Arduino\libraries"
where it finds other libraries.
We'll try that before I have my afternoon martini.
CU

When the IDE saves your sketch, a folder with the same filename as your .INO file is created in the SKETCHBOOK... so your sketch will be saved like this:

c:\\[somepath]\[someDirectory]\yoursketchname\yoursketchname.ino

You find and edit your sketchbook (folder name and folder location) in IDE >> FILE >> PREFERENCES >> SKETCHBOOK LOCATION

You should let the IDE put the libraries it installs into the libraries folder it has created. If you pick another location, you will have errors and warnings of duplicate libraries.

@PaulRB - I have this, too. It seems to be how the IDE installs the libraries. I do not remember selecting or editing a "libraries" folder.

C:\Users\user\Documents\Arduino\sketchbook\libraries

I've had that error. I think it's due to you using Version 3.x of the ESP32 Arduino Core, and ESPAsyncWebServer needs Version 2.x. Don't take my word for it, perhaps someone else will confirm whether I've remembered correctly.

A standard installation will install libraries in that location, the libraries subdirectory of the sketchbook directory. Note that the sketchbook directory is not the same thing as the sketch directory; a sketch can live anywhere.

That's not how it works. Libraries are global, available to all sketches. Each sketch has a currently selected board -- actually a specific board variant in the board platform. Each board platform has its own set of libraries. For example, the esp32 board has WiFi and Bluetooth libraries (and about forty more). You can get a lot done with those, and those are fixed for a given board and version.

(Some modules are part of the platform core and not formal Arduino Libraries. For example, ESP-NOW, which requires <esp_now.h>, a C library. To confuse matters further, there is a board-level library called ESP_NOW, and the header for that is <ESP32_Now.h>, a C++ wrapper library on top.)

Then there are those installed by the Library Manager, which may or may not apply to a particular board.

The board libraries folder is six levels beneath the Arduino15 directory: packages/{vendor}/hardware/{architecture}/{version}/libraries. You've already found the custom libraries inside the sketchbook.

A libraries folder inside your sketch has no special behavior. In fact, the IDE will not even look in there. It only compiles source files in

  • the main folder, which contains the same-name .ino, and any sibling file you create with New Tab
    • a subdirectory named src, if present
      • every subdirectory under that, recursively

and then the linker tries to make sense of it all.

Also, Libraries (and lowercase-L libraries) have headers, but headers are not libraries. A single Library may have multiple headers. Of the ones you mentioned in your OP

  • not capital-L Libraries
    <string.h> // part of the C++ standard library (which you might not even need)
    <esp_now.h> // board core (ESP-IDF)
    
  • board Libraries
    <FS.h>
    <SD.h>
    <SPI.h>
    <WiFi.h>    // both of
    <WiFiUdp.h> // these are part of the WiFi library
    <Wire.h>
    
  • custom Libraries
    <Arduino_JSON.h>
    <AsyncTCP.h>
    <ESPAsyncWebServer.h>
    <LiquidCrystal_I2C.h>
    <NTPClient.h>
    

You can tell at the very end of the verbose output when compiling, when it tells you the versions and location of the libraries. For example

Using library ESP Async WebServer at version 3.7.4 in folder: /Users/kenb4/Arduino/libraries/ESP_Async_WebServer 
Using library FS at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/FS 

The first one is in the sketchbook, and the second under Arduino15. The locations are also shown if you hover over the #include line (once the code compiles well enough for the IDE to find them).

Thanks, all. Very interesting stuff.
I made sure the Preferences were correct, and then I closed down the IDE for the day yesterday. Hopefully it will know where the libraries are at today.
One more thing before I start the day, what is the difference between
#include <xxx.h> and #include "xxx.h"? < > and " "?
Will they both be able to find the library under the Preference value?
Thanks.

The "" form of #include looks for the library files in the sketch folder first before going to the normal library search path. The <> form goes straight to the normal library search path without looking in the sketch folder

OK, here we go.
Because ESPAsyncWebServer was giving me so many problems I downloaded AsyncEspFsWebserver to see if that would work. But I am getting this error:
c:\Users\tonyA\Documents\Arduino\ESP32_ESP_NOW_Weather_Receiver_Server_V8
\libraries
\AsyncEspFsWebserver\src/CaptivePortal.hpp:43:10: error: 'bool CaptiveRequestHandler::canHandle(AsyncWebServerRequest*) const' marked 'override', but does not override
43 | bool canHandle(AsyncWebServerRequest *request) const override {
| ^~~~~~~~~
exit status 1
Can anyone tell me if there is a solution to this?
Thanks