Code compiling on Mac but not on Windows

Hi,

I have this code :

#include <WiFi.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <Arduino.h>
#include <FastLED.h>
#include "M5_EXTIO2.h"


WiFiUDP Udp;
M5_EXTIO2 extio;

#define PIN_LED    21
#define NUM_LEDS   1

CRGB leds[NUM_LEDS];

int adc_0;
int adc_1;
int adc_2;
int adc_3;
int adc_4;
int adc_5;
int adc_6;
int adc_7;


const char* ssid = "LRB WIFI";
const char* pwd = "LRBW1F1!";

const IPAddress ip(192, 168, 0, 207);
const IPAddress gateway(192, 168, 0, 1);
const IPAddress subnet(255, 255, 255, 0);

// for OSC
unsigned int receivePort = 8888;
IPAddress outIp(192, 168, 0, 255);
unsigned int outPort = 7003;


bool ConnectWifi(void)
{
  bool state = true;
  int i = 0;

  WiFi.begin(ssid, pwd);
  WiFi.config(ip, gateway, subnet);
  Serial.println("");
  Serial.println("Connecting to WiFi");
  
  // Wait for connection
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    
    leds[0] = CRGB::Red;
    FastLED.show();
    delay(200);
    leds[0] = CRGB::Black;
    FastLED.show();
    delay(200);

    if (i > 20){
      state = false;
      break;
    }
    i++;
  }
  if (state) {
    Serial.println("");
    Serial.print("Connected to ");
    Serial.println(ssid);
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());

    leds[0] = CRGB::Blue;
    FastLED.show();

  } else {
    Serial.println("");
    Serial.println("Connection failed.");
  }
  
  return state;
}

void setup()
{

  delay(2000);
// Setup Serial Monitor
  Serial.begin(115200);
  Serial.println("Cocorico!"); 

  FastLED.addLeds<WS2812, PIN_LED, GRB>(leds, NUM_LEDS);

  while (!extio.begin(&Wire, 13, 15, 0x45)) {  // Initialize EXT.IO2.
      Serial.println("extio Connect Error");
      delay(100);
    }
  
  extio.setAllPinMode(ADC_INPUT_MODE);  // Set all pins to ADC input mode.

  ConnectWifi(); // Connect to WiFi

}



void loop()
{
  
adc_0 = extio.getAnalogInput(0, _12bit);
adc_1 = extio.getAnalogInput(1, _12bit);
adc_2 = extio.getAnalogInput(2, _12bit);
adc_3 = extio.getAnalogInput(3, _12bit);
adc_4 = extio.getAnalogInput(4, _12bit);
adc_5 = extio.getAnalogInput(5, _12bit);
adc_6 = extio.getAnalogInput(6, _12bit);
adc_7 = extio.getAnalogInput(7, _12bit);



   OSCMessage msg("/coco/6");
   //OSCMessage msg("/coco/piedG");
   //OSCMessage msg("/coco/brasD");
   //OSCMessage msg("/coco/brasG");
   //OSCMessage msg("/coco/dos");
    msg.add(adc_0);
    msg.add(adc_1);
    msg.add(adc_2);
    msg.add(adc_3);
    msg.add(adc_4);
    msg.add(adc_5);
    msg.add(adc_6);
    msg.add(adc_7);
    Udp.beginPacket(outIp, outPort);
    msg.send(Udp);
    Udp.endPacket();
    msg.empty();
    
    
    delay(33);




 }

It compile well on my Mac, but on my Windows machine it gives me this error :

In file included from c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\FastLED\src/FastLED.h:75,
                 from C:\Users\Louis R. Bouchard\Desktop\Projets\COCO\Arduino\IOsmall_To_OSC\IOsmall_To_OSC.ino:5:
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\FastLED\src/fastspi.h:157:23: note: '#pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output'
  157 | #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Louis R. Bouchard\Desktop\Projets\COCO\Arduino\IOsmall_To_OSC\IOsmall_To_OSC.ino:3:
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCMessage.h: In instantiation of 'OSCMessage& OSCMessage::add(T) [with T = int]':
C:\Users\Louis R. Bouchard\Desktop\Projets\COCO\Arduino\IOsmall_To_OSC\IOsmall_To_OSC.ino:129:12:   required from here
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCMessage.h:136:31: error: call of overloaded 'OSCData(int&)' is ambiguous
  136 |                 OSCData * d = new OSCData(datum);
      |                               ^~~~~~~~~~~~~~~~~~
In file included from c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCMessage.h:29:
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:106:5: note: candidate: 'OSCData::OSCData(boolean)'
  106 |     OSCData  (boolean);
      |     ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:102:9: note: candidate: 'OSCData::OSCData(double)'
  102 |         OSCData (double);
      |         ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:101:9: note: candidate: 'OSCData::OSCData(float)'
  101 |         OSCData (float);
      |         ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:100:5: note: candidate: 'OSCData::OSCData(unsigned int)'
  100 |     OSCData (unsigned int);
      |     ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:96:9: note: candidate: 'OSCData::OSCData(int32_t)'
   96 |         OSCData (int32_t);
      |         ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:67:5: note: candidate: 'OSCData::OSCData(char)'
   67 |     OSCData(char t);
      |     ^~~~~~~
c:\Users\Louis R. Bouchard\Documents\Arduino\libraries\OSC/OSCData.h:57:7: note: candidate: 'constexpr OSCData::OSCData(const OSCData&)'
   57 | class OSCData
      |       ^~~~~~~

exit status 1

Compilation error: exit status 1

Someone knows what is wrong with Windows here? I'm using the latest IDE on both.

Thanks!

My first guess is your libraries are at different levels.

What do you mean? I manually deleted the libraries and reinstalled them via the Arduino library manager...

So both the Mac and Win libraries are up to date?

Yes, both are on the same up to date library.

Hi @elby_b. I'm going to ask you to provide the full verbose output from a compilation on each machine. From looking at the verbose output, we might be able to spot the relevant difference between the two environments that is causing the different results.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Obtain verbose output from Mac machine

Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to finish.
  6. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
    A context menu will open.
  7. Select Copy All from the menu.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

Obtain verbose output from Windows machine

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  7. Open a forum reply here by clicking the "Reply" button.
  8. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  9. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  10. Move the cursor outside of the code block markup before you add any additional text to your reply.
  11. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Is the selected Board the same on both machines? Considering the error

that constructor

	OSCData (int32_t);
#ifndef ESPxx
    OSCData (int);
#endif
    OSCData (unsigned int);
	OSCData (float);
	OSCData (double);

is present only

#if defined(ESP8266) || defined(ESP32)
#define ESPxx
#endif

for ESP boards

1 Like

Talking about the selected board make me check the ESP32 boards library version (for this project I'm using M5Stamp-S2) and I was on 3.0.4 on Windows and 2.0.17 on Mac.

I tried 3.0.4 on Mac and it did the same compilation error, and I tried 2.0.17 on Windows and it compiled well. The problem is therefore in the Espressif boards 3.0 update.

I searched a little on ESP32 forum and it seems to be a known problem because 3.0 is a major update. I'll keep looking for a solution there.

Thanks!

1 Like

You can start by looking at this.

1 Like

Just roll boards back to 2.0.17 until the libraries are fixed.

1 Like

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