Bug? [solved]compile error rEthernet on ESP32, Mega, Nano

thetahsk

Active Member
Licensed User
Longtime User
The lib rEthernet produces compile errors:

The Arduino sample programs with ethernet are running without problems on ESP32 and Nano using W5500 interface, using Arduino Ver 1.8.9 and ESP V1.0.3.

The sample programs from B4R using the lib rEthernet produces all errors.
#DefineExtra: #define SKIP_B4RNEW makes no difference.


B4X:
B4R Version: 3.00 BETA #1
Parsing code.    (0.00s)
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Building project    (0.04s)
Compiling & deploying Ino project (ESP32 Dev Module - COM3)    Error
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
C:\B4R\Project\Forum\Error_eth\Objects\bin\sketch\rEthernet.cpp:
 In member function 'void B4R::EthernetServerSocket::Initialize(UInt, B4R::SubVoidEthernetSocket)':
rEthernet.cpp:47:45: error: invalid new-expression of abstract class type 'EthernetServer'
   server = new (backend) EthernetServer(Port);
                                             ^
In file included from C:\B4R\Project\Forum\Error_eth\Objects\bin\sketch\B4RDefines.h:23:0,
                 from C:\B4R\Project\Forum\Error_eth\Objects\bin\sketch\rEthernet.cpp:1:
C:\Program Files (x86)\Arduino\libraries\Ethernet\src/Ethernet.h:253:7: note:
   because the following virtual functions are pure within 'EthernetServer':
 class EthernetServer : public Server {
       ^
In file included from C:\Users\Medion\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3\cores\esp32/Arduino.h:152:0,
                 from C:\B4R\Project\Forum\Error_eth\Objects\bin\sketch\B4RDefines.h:8,
                 from C:\B4R\Project\Forum\Error_eth\Objects\bin\sketch\rEthernet.cpp:1:
C:\Users\Medion\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3\cores\esp32/Server.h:28:18:
 note:     virtual void Server::begin(uint16_t)
     virtual void begin(uint16_t port=0) =0;
                  ^
exit status 1
 
Last edited:

thetahsk

Active Member
Licensed User
Longtime User
rEthernet will not work with ESP32. Which error do you get with Arduino Mega?

Hohohooo, that's impossible because i sold last year a measurement grid with 250 pcs. esp32 working with Wiznet W5500 and B4R. I must check something.

Mega and Nano now running again.
 

thetahsk

Active Member
Licensed User
Longtime User
rEthernet will not work with ESP32. Which error do you get with Arduino Mega?

We must modify the ESP32 core's Server.h. Replacing virtual void begin(uint16_t port=0) =0 with virtual void begin() = 0 make B4R compiling happy.

B4X:
#ifndef server_h
#define server_h

#include "Print.h"

class Server: public Print
{
public:
    // virtual void begin(uint16_t port=0) =0;
    virtual void begin() = 0;
};

#endif
 

Robert_SNOX

New Member
We must modify the ESP32 core's Server.h. Replacing virtual void begin(uint16_t port=0) =0 with virtual void begin() = 0 make B4R compiling happy.

B4X:
#ifndef server_h
#define server_h

#include "Print.h"

class Server: public Print
{
public:
    // virtual void begin(uint16_t port=0) =0;
    virtual void begin() = 0;
};

#endif
Guy Thank you VERY MUCH
You save me, in my problem
 
Top