How to properly include libraries in custom libraries?

Just to be sure I add your fork as dependency in my platformio.ini like the following?

lib_deps =
framework = arduino

platform = espressif32
board = esp32dev
build_flags = -D LED_BUILTIN=22


#include "uTypedef.h"

void setup() {


void loop() {
  // put your main code here, to run repeatedly:

Same issue:
FS.h not found

No I meant rlthe second link from How to properly include libraries in custom libraries? - #6 by sivar2311

Clone the test project and compile it

Your example compiles, but that’s a different scenario, because you are including WiFi in the main.cpp, which I do in the library. If I do it in the main.cpp it compiles fine for my case as well. I guess I have to somehow dive deeper into it. But thanks a lot for the support

I’ve changed the example and my fork to match your requirement: Including WiFi.h / ESP8266WiFi.h by the library instead of including it from main.cpp.

Still works!

See the updated example and fork of your library.

Thank you very much for the support. It looks like the error occurs if AsyncWebServer is used in one of the translation units of the library, but the according header file is not included in main.cpp. This feels very strange for me…

But you said this kind of problem is known for the ESPAsyncWebserver library? Perhaps I will switch to another library.