Sketch no longer compiles. Please help

Hi All,

Going to be in a world of trouble if I can't get this to work quickly. It worked a while back (few months?) but now will not compile. Using ESP8266.

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <LXDMXWiFi.h>
#include <LXWiFiSACN.h>

const char* ssid = "xxxxxxx";
const char* pwd = "xxxxxxx";
uint8_t chan = 2;

LXDMXWiFi* interface; // dmx protocol interface for parsing packets (created in setup)
WiFiUDP wUDP; // An EthernetUDP instance to let us send and receive UDP packets

uint8_t led_state = 0;

void blinkLED() {
  if ( led_state ) {
    digitalWrite(BUILTIN_LED, HIGH);
    led_state = 0;
  } else {
    digitalWrite(BUILTIN_LED, LOW);
    led_state = 1;
  }
}

IPAddress send_address;

void setup() {
  pinMode(BUILTIN_LED, OUTPUT);

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, pwd);
  WiFi.config(IPAddress(192, 168, 1, 124), IPAddress(192, 168, 1, 1), IPAddress(255, 255, 255, 0));

  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
    blinkLED();
  }

  interface = new LXWiFiSACN();  // Initialize Interface (defaults to first universe)
  //interface->setUniverse(1);	        // for different universe, change this line and the multicast address below

  wUDP.beginMulticast(WiFi.localIP(), IPAddress(239, 255, 0, 1), interface->dmxPort());
  send_address = IPAddress(239, 255, 0, 1);

  //note requires v2.1 of ESP8266WiFi library for >494 slots Art-Net
  //prior to fix, total packet size is limited to 512 bytes
  interface->setNumberOfSlots(512);
}


/************************************************************************

  The main loop fades the levels of addresses 7 and 8 to full

*************************************************************************/

void loop() {

  for (int i = 1; i <= 512; i++) {
    interface->setSlot(i, 255);
  }
  interface->sendDMX(&wUDP, send_address, WiFi.localIP());
  delay(5000);

  for (int i = 1; i <= 512; i++) {
    interface->setSlot(i, 0);
  }
  interface->sendDMX(&wUDP, send_address, WiFi.localIP());
  delay(5000);
}
Arduino: 1.8.15 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

/Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp: In member function 'uint16_t LXWiFiSACN::parse_dmp_layer(uint16_t)':
/Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:316:42: error: call of overloaded 'abs(long unsigned int)' is ambiguous
  316 |          if ( abs(millis()-_last_packet_a) > 3000 ) {
      |                                          ^
In file included from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/cores/esp8266/Arduino.h:27,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.h:12,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:22:
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/stdlib.h:74:5: note: candidate: 'int abs(int)'
   74 | int abs (int);
      |     ^~~
In file included from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:77,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/cores/esp8266/Arduino.h:27,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.h:12,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:22:
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
/Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:362:39: error: call of overloaded 'abs(long unsigned int)' is ambiguous
  362 |       if ( abs(millis()-_last_packet_b) > 3000 ) {
      |                                       ^
In file included from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/cores/esp8266/Arduino.h:27,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.h:12,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:22:
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/stdlib.h:74:5: note: candidate: 'int abs(int)'
   74 | int abs (int);
      |     ^~~
In file included from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:77,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
                 from /Users/Alex/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/cores/esp8266/Arduino.h:27,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.h:12,
                 from /Users/Alex/Dropbox/My Mac (Alex Mead 2)/Documents/Arduino/libraries/LXDMXWiFi_Library-master/src/LXWiFiSACN.cpp:22:
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/Users/Alex/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/xtensa-lx106-elf/include/c++/10.3.0/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Your help is much appreciated. Thank you x

sorry no time to help.

1 Like

Have to cut the lawn, maybe next week.

It does no good to say you haven’t time to post correctly , that means anyone who wants to help has to sort your post out first - who wants to do that ?

Anyhow ….

Take bits out until it does compile .

What’s changed ? Different IDE ? Different computer ? File paths now different ? Libraries changed ? Any clues from the error message ? Backup copy ?

1 Like

Hi Hammy,

Thanks for your advice. Your comment regarding my posting correctly is valid and certainly didn't serve to help my predicament. I was near the 'throwing-things-across-the-room' stage which doesn't lead to clear thinking, however I've now resigned myself to the fact that I won't get this sorted in time for my deadline and will just have to face the consequences.

I'll start deleting bits and see where that gets me. Interestingly the example sketches included in the LXDMXWiFi library no longer compile either. This is strange as I haven't upgraded the Arduino IDE or the libraries, am on the same computer, and have tried using a backup copy.

Also tried fully uninstalling and reinstalling the IDE as per some suggestions.

Will keep you posted. Thanks

thanks for fixing your first post.

can you try the following.
Ensure you have the Version 2.0 of the claudeheintz/LXDMXWiFi_Library installed on your shared library folder

download from here:
https://github.com/claudeheintz/LXDMXWiFi_Library/archive/refs/tags/v2.0.zip

Go into the src directory of the library and open for Edit the LXWiFiSACN.cpp file

replace line 234 with
if ( interfaceAddr.isSet() ) { // J-M-L

replace line 316 with
if ( millis() - _last_packet_a > 3000 ) { // J-M-L

replace line 362 with
if ( millis() - _last_packet_b > 3000 ) { // J-M-L

save the file and compile again.

I'm not guaranteeing it works but should solve your compile issue. (couple warnings probably left)

1 Like

Looks like some idiot is trying to take the absolute value of an UNSIGNED number.

Go to line 316 of LXWiFiSACN.cpp and remove that call to abs().

1 Like

and a couple more
:slight_smile:

1 Like

If it worked a while back , it probably was with core 2.7.4 ...

1 Like

Hi all,
Just wanted to say thank you for all your suggestions. Completely awed by your knowledge and humbled by your willingness to help others out with their projects. There is some serious coding skill here.
Whilst this is still the first step in my project (and its future offshoots) it has nonetheless pointed me down my next path - making an wired ethernet version (maybe even PoE powered if Arduino can do that). For now though I'm signing this off as Solved!

Ah possibly may have cluelessly clicked update. Thanks

No problem. We were all new here once.

1 Like

Thanks so much - this did indeed allow it to compile! The program is perhaps not as stable as I remember - although in fairness today was the first day I was running it through its paces at work in a reasonably RF-heavy environment. Would have been rather stuck without it though.

Glad it helped

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.