There are lots of posts on adding AsyncWebServer, but they all involve using the Arduino IDE which I don't use. The problem is getting CMake to include and build the libs. After much searching I still haven't found a working solution.
I have a default ESP-IDF install in C:\Espressif and have an esp-idf project configured as an Arduino sketch for ESP32 and I build using idf.py or ninja. I've had no problems using other Arduino components like Serial, GPIO, WiFi, etc. Now I need to add AsyncWebServer. ESPAsyncWebServer and AsyncTCP aren't included as default Arduino libs, so I downloaded the zips from here:
https://github.com/me-no-dev/ESPAsyncWebServer
https://github.com/me-no-dev/AsyncTCP
and unzipped them to these new directories:
C:\ESP32\wifi\components\arduino\libraries\AsyncTCP
C:\ESP32\wifi\components\arduino\libraries\ESPAsyncWebServer
The first problem is there isn't an include path to these libs (no matter what changes I make to the CMake files) so that when ESPAsyncWebServer\src\ESPAsyncWebServer.h #includes <AsyncTCP.h> it can't find it. I did see that C:\ESP32\wifi\components\arduino\Kconfig.projbuild contains commands to build the Ard libs and that these were missing, so I added them, reran menuconfig, made sure these were enabled and rebuilt. Made no difference.
I must be missing something obvious, but I'm new to CMake and there are make-associated files everywhere, it's not easy to find.
CMakeLists.txt in C:\ESP32\wifi:
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS
"../components/arduino/libraries/AsyncTCP/"
"../components/arduino/libraries/ESPAsyncWebServer/")
include_directories("../components/arduino/libraries/AsyncTCP" "../components/arduino/libraries/ESPAsyncWebServer")
project(wifi)
CMakeLists.txt in C:\ESP32\wifi\main:
idf_component_register(SRCS "main.cpp" "display.cpp" "ws28xx.cpp" "timer.cpp" "wifi.cpp"
INCLUDE_DIRS "." "../components/arduino/libraries/AsyncTCP" "../components/arduino/libraries/ESPAsyncWebServer")
Build output:
c:\ESP32\wifi\build>ninja
[0/1] Re-running CMake...
-- ccache will be used for faster recompilation
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file C:/ESP32/wifi/sdkconfig
-- App "wifi_station" version: 9dddb24-dirty
-- Adding linker script C:/ESP32/wifi/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
-- Adding linker script C:/Espressif/frameworks/esp-idf-v4.4.2/components/soc/esp32/ld/esp32.peripherals.ld
-- Components: app_trace app_update arduino asio bootloader bootloader_support bt cbor cmock coap console cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_ipc esp_lcd esp_local_ctrl esp_netif esp_phy esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos hal heap idf_test ieee802154 jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter tinyusb ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Espressif/frameworks/esp-idf-v4.4.2/components/app_trace C:/Espressif/frameworks/esp-idf-v4.4.2/components/app_update C:/ESP32/wifi/components/arduino C:/Espressif/frameworks/esp-idf-v4.4.2/components/asio C:/Espressif/frameworks/esp-idf-v4.4.2/components/bootloader C:/Espressif/frameworks/esp-idf-v4.4.2/components/bootloader_support C:/Espressif/frameworks/esp-idf-v4.4.2/components/bt C:/Espressif/frameworks/esp-idf-v4.4.2/components/cbor C:/Espressif/frameworks/esp-idf-v4.4.2/components/cmock C:/Espressif/frameworks/esp-idf-v4.4.2/components/coap C:/Espressif/frameworks/esp-idf-v4.4.2/components/console C:/Espressif/frameworks/esp-idf-v4.4.2/components/cxx C:/Espressif/frameworks/esp-idf-v4.4.2/components/driver C:/Espressif/frameworks/esp-idf-v4.4.2/components/efuse C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp-tls C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp32 C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_adc_cal C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_common C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_eth C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_event C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_gdbstub C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hid C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_http_client C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_http_server C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_https_ota C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_https_server C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_ipc C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_lcd C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_local_ctrl C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_netif C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_phy C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_pm C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_ringbuf C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_serial_slave_link C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_timer C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_websocket_client C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_wifi C:/Espressif/frameworks/esp-idf-v4.4.2/components/espcoredump C:/Espressif/frameworks/esp-idf-v4.4.2/components/esptool_py C:/Espressif/frameworks/esp-idf-v4.4.2/components/expat C:/Espressif/frameworks/esp-idf-v4.4.2/components/fatfs C:/Espressif/frameworks/esp-idf-v4.4.2/components/freemodbus C:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos C:/Espressif/frameworks/esp-idf-v4.4.2/components/hal C:/Espressif/frameworks/esp-idf-v4.4.2/components/heap C:/Espressif/frameworks/esp-idf-v4.4.2/components/idf_test C:/Espressif/frameworks/esp-idf-v4.4.2/components/ieee802154 C:/Espressif/frameworks/esp-idf-v4.4.2/components/jsmn C:/Espressif/frameworks/esp-idf-v4.4.2/components/json C:/Espressif/frameworks/esp-idf-v4.4.2/components/libsodium C:/Espressif/frameworks/esp-idf-v4.4.2/components/log C:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip C:/ESP32/wifi/main C:/Espressif/frameworks/esp-idf-v4.4.2/components/mbedtls C:/Espressif/frameworks/esp-idf-v4.4.2/components/mdns C:/Espressif/frameworks/esp-idf-v4.4.2/components/mqtt C:/Espressif/frameworks/esp-idf-v4.4.2/components/newlib C:/Espressif/frameworks/esp-idf-v4.4.2/components/nghttp C:/Espressif/frameworks/esp-idf-v4.4.2/components/nvs_flash C:/Espressif/frameworks/esp-idf-v4.4.2/components/openssl C:/Espressif/frameworks/esp-idf-v4.4.2/components/openthread C:/Espressif/frameworks/esp-idf-v4.4.2/components/partition_table C:/Espressif/frameworks/esp-idf-v4.4.2/components/perfmon C:/Espressif/frameworks/esp-idf-v4.4.2/components/protobuf-c C:/Espressif/frameworks/esp-idf-v4.4.2/components/protocomm C:/Espressif/frameworks/esp-idf-v4.4.2/components/pthread C:/Espressif/frameworks/esp-idf-v4.4.2/components/sdmmc C:/Espressif/frameworks/esp-idf-v4.4.2/components/soc C:/Espressif/frameworks/esp-idf-v4.4.2/components/spi_flash C:/Espressif/frameworks/esp-idf-v4.4.2/components/spiffs C:/Espressif/frameworks/esp-idf-v4.4.2/components/tcp_transport C:/Espressif/frameworks/esp-idf-v4.4.2/components/tcpip_adapter C:/Espressif/frameworks/esp-idf-v4.4.2/components/tinyusb C:/Espressif/frameworks/esp-idf-v4.4.2/components/ulp C:/Espressif/frameworks/esp-idf-v4.4.2/components/unity C:/Espressif/frameworks/esp-idf-v4.4.2/components/usb C:/Espressif/frameworks/esp-idf-v4.4.2/components/vfs C:/Espressif/frameworks/esp-idf-v4.4.2/components/wear_levelling C:/Espressif/frameworks/esp-idf-v4.4.2/components/wifi_provisioning C:/Espressif/frameworks/esp-idf-v4.4.2/components/wpa_supplicant C:/Espressif/frameworks/esp-idf-v4.4.2/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/ESP32/wifi/build
[1/128] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\ESP32\wifi\build\bootloader\esp-idf\esptool_py && python C:/Espressif/frameworks/esp-idf-v4.4.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/ESP32/wifi/build/bootloader/bootloader.bin"
Bootloader binary size 0x6330 bytes. 0xcd0 bytes (11%) free.
[29/126] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/wifi.cpp.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/wifi.cpp.obj
ccache C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -IC:/ESP32/wifi/../components/arduino/libraries/AsyncTCP -IC:/ESP32/wifi/../components/arduino/libraries/ESPAsyncWebServer -IC:/ESP32/wifi/build/config -IC:/ESP32/wifi/main -IC:/ESP32/wifi/main/../components/arduino/libraries/AsyncTCP -IC:/ESP32/wifi/main/../components/arduino/libraries/ESPAsyncWebServer -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/newlib/platform_include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/include/esp_additions/freertos -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/port/xtensa/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/freertos/include/esp_additions -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support/include/soc -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support/include/soc/esp32 -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support/port/esp32/. -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hw_support/port/esp32/private_include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/heap/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/log/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip/include/apps -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip/include/apps/sntp -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip/lwip/src/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip/port/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/lwip/port/esp32/include/arch -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/soc/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/soc/esp32/. -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/soc/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/hal/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/hal/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/hal/platform_port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/include/esp32 -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_rom/esp32 -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_common/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/soc -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/public_compat -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/xtensa/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/xtensa/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/driver/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/driver/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_pm/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_ringbuf/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/efuse/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/efuse/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/vfs/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_wifi/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_event/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_netif/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_eth/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/tcpip_adapter/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_phy/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_phy/esp32/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_ipc/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/app_trace/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_timer/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/mbedtls/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/mbedtls/mbedtls/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/mbedtls/esp_crt_bundle/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/app_update/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/spi_flash/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/bootloader_support/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/nvs_flash/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/pthread/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_gdbstub/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_gdbstub/xtensa -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_gdbstub/esp32 -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/espcoredump/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/espcoredump/include/port/xtensa -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/wpa_supplicant/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/wpa_supplicant/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/wpa_supplicant/esp_supplicant/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/ieee802154/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/console -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/asio/asio/asio/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/asio/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/cbor/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/unity/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/unity/unity/src -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/cmock/CMock/src -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/coap/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/coap/libcoap/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/nghttp/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/nghttp/nghttp2/lib/includes -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp-tls -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp-tls/esp-tls-crypto -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_adc_cal/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_hid/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/tcp_transport/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_http_client/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_http_server/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_https_ota/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_lcd/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_lcd/interface -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/protobuf-c/protobuf-c -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/protocomm/include/common -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/protocomm/include/security -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/protocomm/include/transports -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/mdns/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_local_ctrl/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/sdmmc/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_serial_slave_link/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_websocket_client/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/expat/expat/expat/lib -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/expat/port/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/wear_levelling/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/fatfs/diskio -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/fatfs/vfs -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/fatfs/src -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/freemodbus/common/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/idf_test/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/idf_test/include/esp32 -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/jsmn/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/json/cJSON -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/libsodium/libsodium/src/libsodium/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/libsodium/port_include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/mqtt/esp-mqtt/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/openssl/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/perfmon/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/spiffs/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/ulp/include -IC:/Espressif/frameworks/esp-idf-v4.4.2/components/wifi_provisioning/include -IC:/ESP32/wifi/components/arduino/variants/esp32 -IC:/ESP32/wifi/components/arduino/cores/esp32 -IC:/ESP32/wifi/components/arduino/libraries/ArduinoOTA/src -IC:/ESP32/wifi/components/arduino/libraries/AsyncUDP/src -IC:/ESP32/wifi/components/arduino/libraries/BLE/src -IC:/ESP32/wifi/components/arduino/libraries/BluetoothSerial/src -IC:/ESP32/wifi/components/arduino/libraries/DNSServer/src -IC:/ESP32/wifi/components/arduino/libraries/EEPROM/src -IC:/ESP32/wifi/components/arduino/libraries/ESP32/src -IC:/ESP32/wifi/components/arduino/libraries/ESPmDNS/src -IC:/ESP32/wifi/components/arduino/libraries/Ethernet/src -IC:/ESP32/wifi/components/arduino/libraries/FFat/src -IC:/ESP32/wifi/components/arduino/libraries/FS/src -IC:/ESP32/wifi/components/arduino/libraries/HTTPClient/src -IC:/ESP32/wifi/components/arduino/libraries/HTTPUpdate/src -IC:/ESP32/wifi/components/arduino/libraries/LittleFS/src -IC:/ESP32/wifi/components/arduino/libraries/I2S/src -IC:/ESP32/wifi/components/arduino/libraries/NetBIOS/src -IC:/ESP32/wifi/components/arduino/libraries/Preferences/src -IC:/ESP32/wifi/components/arduino/libraries/RainMaker/src -IC:/ESP32/wifi/components/arduino/libraries/SD_MMC/src -IC:/ESP32/wifi/components/arduino/libraries/SD/src -IC:/ESP32/wifi/components/arduino/libraries/SimpleBLE/src -IC:/ESP32/wifi/components/arduino/libraries/SPIFFS/src -IC:/ESP32/wifi/components/arduino/libraries/SPI/src -IC:/ESP32/wifi/components/arduino/libraries/Ticker/src -IC:/ESP32/wifi/components/arduino/libraries/Update/src -IC:/ESP32/wifi/components/arduino/libraries/USB/src -IC:/ESP32/wifi/components/arduino/libraries/WebServer/src -IC:/ESP32/wifi/components/arduino/libraries/WiFiClientSecure/src -IC:/ESP32/wifi/components/arduino/libraries/WiFi/src -IC:/ESP32/wifi/components/arduino/libraries/WiFiProv/src -IC:/ESP32/wifi/components/arduino/libraries/Wire/src -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=C:/ESP32/wifi=. -fmacro-prefix-map=C:/Espressif/frameworks/esp-idf-v4.4.2=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fno-exceptions -fno-rtti -D_GNU_SOURCE -DIDF_VER=\"v4.4.2-dirty\" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -DARDUINO=10812 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD=\"ESP32_DEV\" -DARDUINO_VARIANT=\"esp32\" -DESP32 -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/wifi.cpp.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\wifi.cpp.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/wifi.cpp.obj -c C:/ESP32/wifi/main/wifi.cpp
In file included from C:/ESP32/wifi/main/wifi.cpp:21:
c:\esp32\wifi\components\arduino\libraries\espasyncwebserver\src\espasyncwebserver.h:33:10: fatal error: AsyncTCP.h: No such file or directory
#include <AsyncTCP.h>
^~~~~~~~~~~~
compilation terminated.
[34/126] Building CXX object esp-idf/arduino/C...ir/libraries/ArduinoOTA/src/ArduinoOTA.cpp.obj
ninja: build stopped: subcommand failed.
After more digging, I found the answer. I had already added this to C:\ESP32\wifi\components\arduino\Kconfig.projbuild:
config ARDUINO_SELECTIVE_AsyncTCP
bool "Enable AsyncTCP"
depends on ARDUINO_SELECTIVE_COMPILATION
default y
config ARDUINO_SELECTIVE_ESPAsyncWebServer
bool "Enable ESPAsyncWebServer"
depends on ARDUINO_SELECTIVE_COMPILATION
default y
Somehow I had missed the CMakeLists.txt in that same directory. It required these additions:
In the "set(includedirs" section:
libraries/AsyncTCP/src
libraries/ESPAsyncWebServer/src
And in the "set(LIBRARY_SRCS:" section:
libraries/AsyncTCP/src/AsyncTCP.cpp
libraries/AsyncUDP/src/AsyncUDP.cpp
and
libraries/ESPAsyncWebServer/src/AsyncEventSource.cpp
libraries/ESPAsyncWebServer/src/AsyncWebSocket.cpp
libraries/ESPAsyncWebServer/src/SPIFFSEditor.cpp
libraries/ESPAsyncWebServer/src/WebAuthentication.cpp
libraries/ESPAsyncWebServer/src/WebHandlers.cpp
libraries/ESPAsyncWebServer/src/WebRequest.cpp
libraries/ESPAsyncWebServer/src/WebResponses.cpp
libraries/ESPAsyncWebServer/src/WebServer.cpp