me-no-dev / AsyncTCP

Async TCP Library for ESP32
GNU Lesser General Public License v3.0
750 stars 432 forks source link

ESP32-S3 Dev Board compilation error FreeRTOS.h #185

Open SergioArrighi opened 6 months ago

SergioArrighi commented 6 months ago

Hello,

I found another issue regarding this exact problem I am experiencing. https://github.com/me-no-dev/AsyncTCP/issues/142

I am using platformio 6.7.0 with esp32-s3-devkitc-1 and -std=c++11.

This is the error I am getting

In file included from .pio/libdeps/esp32-s3-devkitc-1/AsyncTCP/src/AsyncTCP.h:29, from src/StompSubscribeClient.h:9, from src/StompSubscribeClient.cpp:1: /Users/sergioarrighi/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/include/freertos/semphr.h:31:6: error: #error "include FreeRTOS.h" must appear in source files before "include semphr.h"

The workaround I found is to do exactly what it said. In AsyncTPC.h I added the include instruction.

`#include "IPAddress.h"

include "sdkconfig.h"

include

include

extern "C" {

include "freertos/semphr.h"

#include "lwip/pbuf.h"

}`

Let me know if I should open a PR.

Thanks for the terrific job. Best regards

me-no-dev commented 6 months ago

You should #include "freertos/FreeRTOS.h", though why you are getting this error is unclear to me. Maybe there is another FreeRTOS.h that is messing up compilation?