Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code does not compile #44

Closed
lesept777 opened this issue May 1, 2019 · 4 comments
Closed

Code does not compile #44

lesept777 opened this issue May 1, 2019 · 4 comments

Comments

@lesept777
Copy link

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

@gtalusan
Copy link

I'm having the same problem using the ESP32 1.0.3-rc1 Arduino package. Reverting 6fab772 in this repository makes it compile.

@atanisoft
Copy link
Contributor

If you are still encountering this with arduino-esp32 1.0.2 or 1.0.3-rc1 you are not compiling against that version. You will need to clear the arduino IDE cached libraries and platform versions and ensure it is compiling against the latest versions.

@lesept777
Copy link
Author

I went back to 1.8.5 and everything is fine now, thanks

@atanisoft
Copy link
Contributor

@lesept777 if your issue is fixed please consider closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants