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

Strange compiling errors since change to git version. #5390

Closed
3 of 6 tasks
crndn2018 opened this issue Nov 29, 2018 · 17 comments
Closed
3 of 6 tasks

Strange compiling errors since change to git version. #5390

crndn2018 opened this issue Nov 29, 2018 · 17 comments
Assignees

Comments

@crndn2018
Copy link

crndn2018 commented Nov 29, 2018

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: [e7d3cf6]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [qio]
  • Flash Size: [4MB]
  • 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

After i have changed from Core 2.4.2 to latest git version (2.5.0-dev, Commit e7d3cf6) my project does not compile. I get many errors related to private libraries (e.g. W5500 library for ESP) but also related to ESP internal libraries.
Unfortunately i cannot provide any source code because its a professional iot project for my company.
Please have a look a the following error messages. The most error messages concern classes containing virtual methods. All classes with virtual methods now dealed as abstract classes and cannot be instanced.
A problem i was not faced with Core 2.4.2. Additionally i get conflicting declarations.

Debug Messages

Arduino: 1.8.5 (Windows 7), Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, QIO, 4M (1M SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:232:0:

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266/tools/sdk/include/espconn.h:32:15: error: conflicting declaration 'typedef sint8 err_t'

 typedef sint8 err_t;

               ^

In file included from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266/tools/sdk/lwip2/include/lwip/netif.h:44:0,

                 from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/AddrList.h:79,

                 from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/IPAddress.h:196,

                 from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266WiFi\src/ESP8266WiFi.h:31,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:221:

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266/tools/sdk/lwip2/include/lwip/err.h:94:20: error: 'err_t' has a previous declaration as 'typedef s32_t err_t'

 typedef LWIP_ERR_T err_t;

                    ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:12:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetServer.h:18:18: error: invalid abstract return type for member function 'EthernetClient EthernetServer::available()'

   EthernetClient available();

                  ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   because the following virtual functions are pure within 'EthernetClient':

 class EthernetClient : public Client {

       ^

In file included from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266WiFi\src/WiFiClient.h:27:0,

                 from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:221:

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Client.h:29:21: note: 	virtual int Client::connect(const IPAddress&, uint16_t)

         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;

                     ^

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Client.h:37:22: note: 	virtual bool Client::flush(unsigned int)

         virtual bool flush(unsigned int maxWaitMs = 0) = 0;

                      ^

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Client.h:38:22: note: 	virtual bool Client::stop(unsigned int)

         virtual bool stop(unsigned int maxWaitMs = 0) = 0;

                      ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:12:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetServer.h:19:18: error: invalid abstract return type for member function 'EthernetClient EthernetServer::available(uint8_t)'

   EthernetClient available(uint8_t socket);

                  ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:13:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/DhcpESP.h:158:15: error: cannot declare field 'DhcpClass::_dhcpUdpSocket' to be of abstract type 'EthernetUDP'

   EthernetUDP _dhcpUdpSocket;

               ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/DhcpESP.h:7:0,

                 from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:13,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetUdp.h:44:7: note:   because the following virtual functions are pure within 'EthernetUDP':

 class EthernetUDP : public UDP {

       ^

In file included from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266WiFi\src/WiFiUdp.h:25:0,

                 from C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266httpUpdate\src/ESP8266httpUpdate.h:34,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:222:

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Udp.h:81:27: note: 	virtual IPAddress UDP::remoteIP() const

         virtual IPAddress remoteIP() const =0;

                           ^

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Udp.h:83:26: note: 	virtual uint16_t UDP::remotePort() const

         virtual uint16_t remotePort() const =0;

                          ^

SmartEnergyMeter:412: error: invalid abstract type 'EthernetClient' for 'ecEthernetClient'

 EthernetClient ecEthernetClient[ETHERNET_MAX_SOCK_NUM];

                                                      ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino: In function 'void EthernetPoll()':

SmartEnergyMeter:5401: error: cannot allocate an object of abstract type 'EthernetClient'

   if (esEthernetServer.available()) 

                                  ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

SmartEnergyMeter:5406: error: cannot allocate an object of abstract type 'EthernetClient'

       EthernetClient ecClient = esEthernetServer.available(i);

                                                             ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

SmartEnergyMeter:5406: error: cannot declare variable 'ecClient' to be of abstract type 'EthernetClient'

       EthernetClient ecClient = esEthernetServer.available(i);

                      ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino: In function 'void EthernetPollStreaming()':

SmartEnergyMeter:5545: error: cannot allocate an object of abstract type 'EthernetClient'

   if (esEthernetStreamingServer.available())

                                           ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

SmartEnergyMeter:5550: error: cannot allocate an object of abstract type 'EthernetClient'

       EthernetClient ecClient = esEthernetStreamingServer.available(i);

                                                                      ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

SmartEnergyMeter:5550: error: cannot declare variable 'ecClient' to be of abstract type 'EthernetClient'

       EthernetClient ecClient = esEthernetStreamingServer.available(i);

                      ^

In file included from C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetESP.h:11:0,

                 from C:\Users\CD\Documents\Arduino\SmartEnergyMeter\2018-11-29\SmartEnergyMeter\SmartEnergyMeter.ino:240:

C:\Users\CD\Documents\Arduino\libraries\EthernetESP\src/EthernetClient.h:8:7: note:   since type 'EthernetClient' has pure virtual functions

 class EthernetClient : public Client {

       ^

exit status 1
invalid abstract type 'EthernetClient' for 'ecEthernetClient'
@d-a-v d-a-v self-assigned this Nov 29, 2018
@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

This is related to latest version of lwIP-2.1.2.
I can't reproduce with Ethernet examples.
Are you using espconn ?
Can you try ethernet examples on your side and report ?

@crndn2018
Copy link
Author

Yes, I am using espconn ! The Ethernet Library is the default Arduino library for W5100. We have modified it for use with W5500. I will try to get it run with the default ethernet examples in the next hours.
As I mentioned I cannot provide any source code except my includes:

extern "C"
{
#include "user_interface.h"
#include "espconn.h"
}

#include <EthernetESP.h>
#include <utility/w5100.h> // Don't wonder about this. Its working with W5500 behind.
#include <utility/socket.h>

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

Try with this first

#include <../../lwip2/include/lwip-err-t.h>

This should work with both lwIP-v1.4 and lwIP-v2.

This file is autogenerated and extract err_t from espressif lwip-v1.4 sources.

@crndn2018
Copy link
Author

I have tried the following. Same result. Not working.

#include <../../lwip2/include/lwip-err-t.h>
extern "C"
{
#include "user_interface.h"
#include "espconn.h"
}

#include <EthernetESP.h>
#include <utility/w5100.h>
#include <utility/socket.h>

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

What about modifying tools/sdk/include/espconn.h:32:15, by replacing

typedef sint8 err_t;

by

//typedef sint8 err_t;
#include <../../lwip2/include/lwip-err-t.h>
#include <lwip/err.h>

@crndn2018
Copy link
Author

Conflicting declaration vanished.

Problems with virtual methods remaining. Something changed in the toolchain ?

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

Conflicting declaration vanished.

Thanks, I will commit this fix

Problems with virtual methods remaining. Something changed in the toolchain ?

Not with the toolchain, but mainly with IPAddress.
You were saying that you have a modified version of W5100 to allow W5500.
Here are the changes to the core: https://github.com/esp8266/Arduino/pull/5136/files
You also have another way to use your W5500 but it is still beta.

@crndn2018
Copy link
Author

The errors related to sections we did not change. E.g. Class "EthernetClient" contains virtual methods since beginning. And what's about the following. These are ESP internal libraries. The alternative W5500 library i have already checked. That's not enough for us.
I am a little bit confused. If i change to 2.4.2 all works fine. I have repeated the installtion process for git version on windows three times. No change. By the way, this not really documented. Fished it from a discussion board. Perhaps you find an answer to the open questions in the next days.
But first, thanks for your support !

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Udp.h:81:27: note: virtual IPAddress UDP::remoteIP() const

     virtual IPAddress remoteIP() const =0;

                       ^

C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Udp.h:83:26: note: virtual uint16_t UDP::remotePort() const

     virtual uint16_t remotePort() const =0;

@devyte
Copy link
Collaborator

devyte commented Nov 29, 2018

@crndn2018 said:

The alternative W5500 library i have already checked. That's not enough for us.

Can you please provide details as to why? This is important. We're moving towards a unified tcp/ip stack that includes the Ethernet class, and could potentially include other interfaces in the future. There are plans for after this is finalized.

@crndn2018
Copy link
Author

Looking for interfaces like WifiClient/WifiServer.

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

E.g. Class "EthernetClient" contains virtual methods since beginning

Signatures recently changed, I provided the link with all changes.

virtual IPAddress remoteIP() const =0;
virtual uint16_t remotePort() const =0;

Both are working in current git version.

Looking for interfaces like WifiClient/WifiServer.

That is the point of this new library.

@devyte
Copy link
Collaborator

devyte commented Nov 29, 2018

In fact, in @d-a-v 's alternate Ethernet implementation EthernetClient would essentially be replaced, or aliased to, WiFiClient. Same for WiFiServer.
The plus side: you get ssl, http client, web server, and all the other goodies available for WiFi for free, or very close to it, on Ethernet.

@crndn2018
Copy link
Author

OK, sorry, i misunderstood this. Perhaps you add an basic example, how to use it. For donkeys, like me ;)

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 29, 2018

It's WIP, check d-a-v/W5500lwIP#3

@crndn2018
Copy link
Author

My version of the Ethernet-Library overloads the methods whose signatures have changed. Corrected. Running.
My last bug:

#Sketch
extern "C"
{
#include "user_interface.h"
#include "espconn.h"
}

void setup() {
espconn_tcp_set_max_con(8);
}

void loop() {
// put your main code here, to run repeatedly:

}

#Debug messages
sketch\sketch_nov30a.ino.cpp.o:(.text.setup+0x0): undefined reference to `espconn_tcp_set_max_con'

sketch\sketch_nov30a.ino.cpp.o: In function `setup':

C:\Users\CD\Documents\Arduino\sketch_nov30a/sketch_nov30a.ino:8: undefined reference to `espconn_tcp_set_max_con'

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 30, 2018

espconn is a specific espressif api shipped with lwIP-v1.4
(it's a modified version of lwIP 's netconn API).
Try selecting lwIP-v1.4 in Tools menu instead (lwIP-v2 is default since core-2.4).

I ported it to lwIP-v2 but you show it is incomplete. It is anyway far to be tested nor proven to be working. Please open a new issue for this specific request but I'm afraid that will not be a priority.
Maybe you could port your code to use our (arduino/esp8266) WiFi API ?

@crndn2018
Copy link
Author

Tried lwIP v1.4. Not working.
This worked lwIP v2 in Core 2.4.2. I will open a new issue.
Let's close 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