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

espconn.h - conflicting declaration of dns_found_callback #9056

Open
5 of 6 tasks
vgahlaut opened this issue Dec 19, 2023 · 1 comment
Open
5 of 6 tasks

espconn.h - conflicting declaration of dns_found_callback #9056

vgahlaut opened this issue Dec 19, 2023 · 1 comment

Comments

@vgahlaut
Copy link

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [3.1.2]
  • Development Env: [Arduino IDE|
  • Operating System: [Windows|]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [dio]
  • Flash Size: [4MB/1MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [ck]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

Detailed problem description goes here.

If we include sdk espconn.h in our code. It gets conflicting type of dns_found_callback during compilation. Compilation error and sketch are provided to reproduce problem.

Request you to please suggest some workaround to get over this issue.

MCVE Sketch

extern "C"{
    // Platform Includes
    #include <espconn.h>
}

#include <ESP8266WiFi.h>

// the setup function runs once when you press reset or power the board
void setup() {
  Serial.begin(115200);
  WiFi.begin((char*)"testssid", (char*)"testpassword");
}
void loop() {
  
}

Debug Messages

In file included from C:\Users\vipin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:29,
                 from C:\Users\vipin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28,
                 from C:\Users\vipin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
                 from C:\Users\vipin\Desktop\dns_found_cb_reproducer\dns_found_cb_reproducer.ino:16:
C:\Users\vipin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/sdk/lwip2/include/lwip/dns.h:103:16: error: conflicting declaration 'typedef void (* dns_found_callback)(const char*, const ip_addr_t*, void*)'
  103 | typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg);
      |                ^~~~~~~~~~~~~~~~~~
In file included from C:\Users\vipin\Desktop\dns_found_cb_reproducer\dns_found_cb_reproducer.ino:13:
C:\Users\vipin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/sdk/include/espconn.h:447:16: note: previous declaration as 'typedef void (* dns_found_callback)(const char*, ip4_addr_t*, void*)'
  447 | typedef void (*dns_found_callback)(const char *name, ipv4_addr_t *ipaddr, void *callback_arg);
@mcspr
Copy link
Collaborator

mcspr commented Dec 20, 2023

Was previously mentioned in #8920 (comment)
You could follow the comment suggestion and delete the conflicting typedef line from espconn.h

I wonder if we should just rename dns_found_callback inside of espconn.h to something like espconn_dns_found_callback
(assuming espconn actually still works)

@mcspr mcspr changed the title conflicting declaration of dns_found_callback espconn.h - conflicting declaration of dns_found_callback Dec 20, 2023
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

2 participants