Compiler Error On Two Computers

Hardware
iMac and MBPro both on OSX v12.6

Board
Adafruit Feather MO WIFI

IDE
v1.8.19 and v2.0.1

If I compile my sketch on the iMac it compiles without any error using either IDE,
If I compile the same exact sketch on the MBPro - using either IDE - it gets the following error:

Can someone shed some light on why this is happening?

I have been working on this sketch for several months and have NEVER seen this error before. Any help will be greatly appreciated.

Thank you.

See the "Copy error messages" button?

Please push that button and paste the entire error message into your post, using code tags, and delete the useless screen shot.

I will be happy to do as you suggested, but the cause of the compiler error was not my question. My question was why do I get this error on one computer and not the other all things being equal?

For the sake of clarity, the reference to 'MBPRO-ONE' is the name of the thumb drive that the sketch is on.

I had to turn Verbose compilation off because the text exceeded the max limit.

Here is the non-verbose error message:

Arduino: 1.8.19 (Mac OS X), Board: "Adafruit Feather M0 (SAMD21), Small (-Os) (standard), Arduino, Off"

In file included from /Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:342:
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:28: warning: "strncpy_P" redefined
   28 | #define strncpy_P(dest, src, len) strncpy((dest), (src), (len))
      | 
In file included from /Users/phillipanthonybriles/Library/Arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/Arduino.h:36,
                 from sketch/talavera_final_05DEV21-v02.ino.cpp:1:
/Users/phillipanthonybriles/Library/Arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/avr/pgmspace.h:74: note: this is the location of the previous definition
   74 | #define strncpy_P(s1, s2, n) strncpy((s1), (s2), (n))
      | 
In file included from /Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:342:
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:29: warning: "strncasecmp_P" redefined
   29 | #define strncasecmp_P(f1, f2, len) strncasecmp((f1), (f2), (len))
      | 
In file included from /Users/phillipanthonybriles/Library/Arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/Arduino.h:36,
                 from sketch/talavera_final_05DEV21-v02.ino.cpp:1:
/Users/phillipanthonybriles/Library/Arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/avr/pgmspace.h:72: note: this is the location of the previous definition
   72 | #define strncasecmp_P(s1, s2, n) strncasecmp((s1), (s2), (n))
      | 
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'void tmpHum_read(float)':
talavera_final_05DEV21-v02:564:37: error: call of overloaded 'publish(volatile float&, int)' is ambiguous
  564 |       temperature.publish(val_temp,0);   // publish the ºF temp data with zero(0) decimal values ...        OFF   !!!!!!!!!!!
      |                                     ^
In file included from /Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:342:
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:293:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(double, uint8_t)'
  293 |   bool publish(
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:298:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(double, bool, uint8_t)'
  298 |   bool publish(double f, bool retain, uint8_t precision = 2);
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:300:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(int32_t, bool)'
  300 |   bool publish(int32_t i, bool retain);
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:302:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(uint32_t, bool)'
  302 |   bool publish(uint32_t i, bool retain);
      |        ^~~~~~~
talavera_final_05DEV21-v02:565:35: error: call of overloaded 'publish(volatile float&, int)' is ambiguous
  565 |       humidity.publish(val_humid,0);       // publish the humidity data with zero(0) decimal values ...     OFF   !!!!!!!!!!!!
      |                                   ^
In file included from /Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:342:
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:293:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(double, uint8_t)'
  293 |   bool publish(
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:298:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(double, bool, uint8_t)'
  298 |   bool publish(double f, bool retain, uint8_t precision = 2);
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:300:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(int32_t, bool)'
  300 |   bool publish(int32_t i, bool retain);
      |        ^~~~~~~
/Users/phillipanthonybriles/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:302:8: note: candidate: 'bool Adafruit_MQTT_Publish::publish(uint32_t, bool)'
  302 |   bool publish(uint32_t i, bool retain);
      |        ^~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:562:11: warning: unused variable 'tmpHum_seconds' [-Wunused-variable]
  562 |       int tmpHum_seconds = tmp_currentMillis / 1000;   // convert milliseconds to seconds ...
      |           ^~~~~~~~~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'void blink(int, int)':
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:580:40: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
  580 |     if (currentMillis - previousMillis >= interval) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'void power_check(float)':
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:609:21: warning: unused variable 'currentMillis' [-Wunused-variable]
  609 |       unsigned long currentMillis = millis();
      |                     ^~~~~~~~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:601:26: warning: unused parameter 'interval' [-Wunused-parameter]
  601 |   void power_check(float interval)
      |                    ~~~~~~^~~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'float readDistance(float)':
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:709:28: warning: unused parameter 'data' [-Wunused-parameter]
  709 |   float readDistance(float data)
      |                      ~~~~~~^~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'void read_tank_level(float)':
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino:786:15: warning: unused variable 'wtr_seconds' [-Wunused-variable]
  786 |           int wtr_seconds = wtr_currentMillis / 1000;  // convert ms to seconds ...
      |               ^~~~~~~~~~~
/Volumes/MBPRO-ONE/Talavera Project ƒ/Old MBPro ƒ/Talaver Final Sketches - 2 ƒ/talavera_final_05DEV21-v02/talavera_final_05DEV21-v02.ino: In function 'float readDistance(float)':
talavera_final_05DEV21-v02:737:3: error: control reaches end of non-void function [-Werror=return-type]
  737 |   } //  end of readDistance(...)  ================================================
      |   ^
cc1plus: some warnings being treated as errors
exit status 1
call of overloaded 'publish(volatile float&, int)' is ambiguous


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

According to the error messages, it appears that you have conflicting libraries loaded on that computer. Remove the wrong one.

There are many problems with your code, so it would be a good idea to go through the warnings and fix them.

Got it. I will go over all of the error messages and see what I can find.

Thank you.

The obvious reason is that they are not equal

That's the understatement of the day. I have begun to wonder if the IDE is not reading the Arduino library files from the thumb drive that the sketch is on. I am testing that at the moment. I will know more in a few minutes.

Bringing this new computer up to 'speed' with all the libraries has not been fun.

Thanks.

You could have just copied the libraries folder over to the new PC

This is precisely what I did do which is why the Arduino Library folder was on the thumb drive. Some of the errors that I am seeing are making reference to the Mac's Library files. This is the 'hidden' library of the Mac.

Here is an example:

Thanks.

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