Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Code does not compile #44

Closed
Closed
@lesept777

Description

@lesept777

I want to try a code found here : https://techtutorialsx.com/

Here is the error message
`Arduino : 1.8.9 (Windows 10), Carte : "LOLIN D32, Default, 80MHz, 921600, None"

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:32: error: field 'call' has incomplete type 'tcpip_api_call_data'

 struct tcpip_api_call_data call;

                            ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: forward declaration of 'struct tcpip_api_call_data'

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_output(tcp_pcb*)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:295:70: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_output_api, (struct tcpip_api_call_data*)&msg);

                                                                  ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:295:70: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_write(tcp_pcb*, const char*, size_t, uint8_t)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:311:69: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_write_api, (struct tcpip_api_call_data*)&msg);

                                                                 ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:311:69: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_recved(tcp_pcb*, size_t)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:326:70: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call_data*)&msg);

                                                                  ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:326:70: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_connect(tcp_pcb*, ip_addr_t*, uint16_t, tcp_connected_fn)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:342:71: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call_data*)&msg);

                                                                   ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:342:71: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_close(tcp_pcb*)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:356:69: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_close_api, (struct tcpip_api_call_data*)&msg);

                                                                 ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:356:69: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_abort(tcp_pcb*)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:371:69: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_abort_api, (struct tcpip_api_call_data*)&msg);

                                                                 ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:371:69: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_bind(tcp_pcb*, ip_addr_t*, uint16_t)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:386:68: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_bind_api, (struct tcpip_api_call_data*)&msg);

                                                                ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:386:68: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'tcp_pcb* _tcp_listen_with_backlog(tcp_pcb*, uint8_t)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:401:70: error: invalid conversion from 'err_t ()(tcpip_api_call_data) {aka signed char ()(tcpip_api_call_data)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call)}' [-fpermissive]

 tcpip_api_call(_tcp_listen_api, (struct tcpip_api_call_data*)&msg);

                                                                  ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:401:70: error: cannot convert 'tcpip_api_call_data*' to 'tcpip_api_call*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call*)'

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call_data' is incomplete

 struct tcpip_api_call_data call;

        ^

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In member function 'void AsyncClient::_dns_found(ip_addr*)':

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:643:33: error: invalid use of incomplete type 'struct ip_addr'

     connect(IPAddress(ipaddr->u_addr.ip4.addr), _connect_port);

                             ^

In file included from C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:24:0:

C:\Users\Chuwi\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.h:46:8: note: forward declaration of 'struct ip_addr'

struct ip_addr;

    ^

Plusieurs bibliothèque trouvées pour "WiFi.h"
Utilisé : C:\Users\Chuwi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi
Non utilisé : C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Erreur de compilation pour la carte LOLIN D32

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.
`

And here is the code
#include "WiFi.h"
#include <FS.h>
#include <AsyncTCP.h>
#include "ESPAsyncWebServer.h"

const char* ssid = "---";
const char* password = "---";

AsyncWebServer server(80);

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.printf("Connecting to %s ", ssid);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print("\nServer IP: ");
Serial.println(WiFi.localIP());
Serial.println("\n\n");

server.on("/hello", HTTP_GET, [](AsyncWebServerRequest * request) {
request->send(200, "text/plain", "Hello World");
});

server.on("/printIp", HTTP_GET, [](AsyncWebServerRequest * request) {
request->send(200, "text/plain", "ok");
Serial.print("Received request from client with IP: ");
Serial.println(request->client()->remoteIP());
});

server.on(
"/post", HTTP_POST, [](AsyncWebServerRequest * request) {}, NULL,
[](AsyncWebServerRequest * request, uint8_t *data, size_t len, size_t index, size_t total) {
for (size_t i = 0; i < len; i++) Serial.write(data[i]);
Serial.println();
request->send(200);
});

server.begin();
}

void loop() {}

I'm using the latest IDE version 1.8.9 (but I had the same issue with v1.8.0) and selected either LOLIN D32 or ESP32 dev module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions