Skip to content

espconn.h compile error ipv4_addr_t undefined #5753

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

Closed
martin-ger opened this issue Feb 11, 2019 · 4 comments · Fixed by #6740
Closed

espconn.h compile error ipv4_addr_t undefined #5753

martin-ger opened this issue Feb 11, 2019 · 4 comments · Fixed by #6740
Assignees
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.

Comments

@martin-ger
Copy link

martin-ger commented Feb 11, 2019

Basic Infos

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

Platform

  • Hardware: [ESP-12]
  • Core Version: [V2.5, 11/2/2019]
  • Development Env: [Arduino IDE]
  • Operating System: [UbuntuS]

Settings in IDE

  • Module: [Wemos D1 mini r2]
  • Flash Mode: [dio]
  • Flash Size: [4MB]
  • lwip Variant: [v1.4|Higher Bandwidth]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

Include of espconn.h results in an compiler error (worked in V2.4.2):

In file included from /tmp/arduino_modified_sketch_278302/WiFiClient.ino:2:0:
/home/mfg/.arduino15/packages/esp8266/hardware/esp8266/2.5.0/tools/sdk/include/espconn.h:451:54: error: 'ipv4_addr_t' has not been declared
 typedef void (*dns_found_callback)(const char *name, ipv4_addr_t *ipaddr, void *callback_arg);
                                                      ^

Following addition in espconn.h solves it:

#ifndef ipv4_addr_t
#define ipv4_addr_t ip_addr_t
#endif

MCVE Sketch

#include <Arduino.h>
#include <espconn.h>

void setup() {

}

void loop() {

}

Debug Messages

Debug messages go here
@pfeerick
Copy link
Contributor

pfeerick commented Feb 19, 2019

Edit: Removed first bit as is was my addition to IPAddress.h that got it working... after line 34 may be a good place to add #define ipv4_addr_t ip_addr_t as ipv4_addr is there also...

#define ipv4_addr ip_addr

Is espconn supposed to work with LWIP1.4 though? ... as the commit that added espconn states "lwip2: port esp-ping and espconn"

@devyte
Copy link
Collaborator

devyte commented Nov 9, 2019

@d-a-v I suspect this can be closed. Do we still support the espconn layer?

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Nov 9, 2019
@d-a-v
Copy link
Collaborator

d-a-v commented Nov 9, 2019

espconn is supported by lwIP-1.4
it is not officially supported by lwip2, but it is ported and untested.
espconn_init() has to be called before using it with lwip2.

@pfeerick do you intend to make a PR with your proposed update ?

@pfeerick
Copy link
Contributor

pfeerick commented Nov 9, 2019

@d-a-v Probably should do... completely forgot about this as the OP never replied. I'll test this again and push the change if it's still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants