Problem when compiling : multiple definition of `Serial'

Hi everybody,

I’m facing a problem with a sketch found on this github : GitHub - claudeheintz/LXDMXWiFi_Library: Library for ESP8266 implements Art-Net and sACN with example DMX input/output to/from network

The sketch used is this one : ESP32-DMX_rdm

It’s a great design which purpose is to use Artnet/DMX to wirelessly control scene lights with ESP32.

I asked some advice to the author but it seems that his last commit is ok on his side and I don’t understand where I miss something on my side.

I have done a fresh installation of Arduino IDE 1.8.6, added suport for ESP32 boards, imported libraries needed (LXESP32DMX, LXDMXWIFI, …) in the skecthbook libraries folder.

Everything seems to be compiling quite well, except at the end when “Linking everything together” I face this error :

C:\Users\XYOL8240\AppData\Local\Temp\arduino_build_581954/ multiple definition of `Serial'

C:\Users\XYOL8240\AppData\Local\Temp\arduino_build_581954\libraries\LXESP32DMX-master\LXESP32DMX.cpp.o:(.bss.Serial+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

Plusieurs bibliothèque trouvées pour "WiFi.h"
Utilisé : C:\Users\XYOL8240\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi
Non utilisé : C:\Program Files (x86)\Arduino\libraries\WiFi
Utilisation de la bibliothèque LXESP32DMX-master version 1.2 dans le dossier: C:\Users\XYOL8240\Documents\Arduino\libraries\LXESP32DMX-master 
Utilisation de la bibliothèque WiFi version 1.0 dans le dossier: C:\Users\XYOL8240\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi 
Utilisation de la bibliothèque LXDMXWiFi_Library-master version 2.0 dans le dossier: C:\Users\XYOL8240\Documents\Arduino\libraries\LXDMXWiFi_Library-master 
Utilisation de la bibliothèque LXDMXWiFiConfig prise dans le dossier : C:\Users\XYOL8240\Documents\Arduino\libraries\LXDMXWiFiConfig (legacy)
exit status 1
Erreur de compilation pour la carte Adafruit ESP32 Feather

I attached the debug output of the compilation.

Note : I used the “corrected” version of the LXESP32DMX on the github repo as advised by the author, but it seems to remain the same.

Any help appreciated.


debug_07-09-18.txt (489 KB)

Problem Solved,

There was still an error in the author library LXESP32DMX :

the line "HardwareSerial" was still there for testing purpose and has been forgotten here before the commit.

Everything is correct now.

Thanks to those who have read this thread.

Who cares about the "debug" output from the compilation.

Where's the code! DOH!


The solution is:

In HardwareSerial.cpp delete #include "pins_arduino.h", #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL), HardwareSerial Serial1(1), HardwareSerial Serial2(2) and #end if

That's all, enjoy it.