M5Stack icon indicating copy to clipboard operation
M5Stack copied to clipboard

Compilation error: cannot declare variable 'server' to be of abstract type 'EthernetServer..

Open yltsa opened this issue 10 months ago • 8 comments

Hi,

I try to compile

examples/Modules/Base_PoE/LAN_W5500/WebServer/WebServer.ino Arduino example.

There comes always this error:

Compilation error: cannot declare variable 'server' to be of abstract type 'EthernetServer'

The board is CoreS3,

yltsa avatar Feb 11 '25 20:02 yltsa

Don't forget to provide your code.

TinyuZhao avatar Feb 12 '25 01:02 TinyuZhao

It is this code from M5Stack examples:

https://github.com/m5stack/M5Stack/blob/master/examples/Modules/Base_PoE/LAN_W5500/WebServer/WebServer.ino

yltsa avatar Feb 12 '25 05:02 yltsa

This is the library file of the M5Core generation host(M5Fire, M5Basic, M5Gray), you are sure that this is the program that compiles the M5Core S3 host, and I tested the compilation without any problems.

Image

TinyuZhao avatar Feb 12 '25 06:02 TinyuZhao

I have this error:

Image

yltsa avatar Feb 12 '25 08:02 yltsa

Can you provide all the logs?

Image

TinyuZhao avatar Feb 12 '25 08:02 TinyuZhao

hello, @yltsa Perhaps you are mixing the following two? If you do, a conflict will occur and the compile will not work.

// #include <M5Stack.h>    // <- NO NEED THIS.
#include <M5CoreS3.h> // <- need for CoreS3

Also, the argument to the begin function will probably not be necessary.

//  M5.begin(true, false, true);  // <- NG
  M5.begin();                      // <- OK

lovyan03 avatar Feb 17 '25 07:02 lovyan03

As Lovyan said, and these pins don't work with the M5CoreS3 either, Only work for M5Fire, M5Basic, M5Gray

TinyuZhao avatar Feb 17 '25 08:02 TinyuZhao