Radiohead library compile issues

Hi all

I'm using a NaNo IOT 33 to run the Radiohead library and the AddrDemo_RX example program. When I compile I get

In file included from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:0:
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:152:29: error: expected ')' before '&' token
     RH_Serial(HardwareSerial& serial);
                             ^
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:156:5: error: reference to 'HardwareSerial' is ambiguous
     HardwareSerial& serial();
     ^~~~~~~~~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:40:7: note: candidates are: class HardwareSerial
 class HardwareSerial;
       ^~~~~~~~~~~~~~
In file included from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Uart.h:21:0,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\variants\nano_33_iot/variant.h:179,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Arduino.h:51,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RadioHead.h:1174,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RHGenericDriver.h:9,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:12,
                 from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:
C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/HardwareSerial.h:87:7: note:                 class arduino::HardwareSerial
 class HardwareSerial : public Stream
       ^~~~~~~~~~~~~~
In file included from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:0:
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:234:5: error: reference to 'HardwareSerial' is ambiguous
     HardwareSerial& _serial;
     ^~~~~~~~~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:40:7: note: candidates are: class HardwareSerial
 class HardwareSerial;
       ^~~~~~~~~~~~~~
In file included from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Uart.h:21:0,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\variants\nano_33_iot/variant.h:179,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Arduino.h:51,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RadioHead.h:1174,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RHGenericDriver.h:9,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:12,
                 from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:
C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/HardwareSerial.h:87:7: note:                 class arduino::HardwareSerial
 class HardwareSerial : public Stream
       ^~~~~~~~~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:15:21: error: expected constructor, destructor, or type conversion before '(' token
 RH_Serial::RH_Serial(HardwareSerial& serial)
                     ^
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:22:1: error: reference to 'HardwareSerial' is ambiguous
 HardwareSerial& RH_Serial::serial()
 ^~~~~~~~~~~~~~
In file included from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:0:
d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:40:7: note: candidates are: class HardwareSerial
 class HardwareSerial;
       ^~~~~~~~~~~~~~
In file included from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Uart.h:21:0,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\variants\nano_33_iot/variant.h:179,
                 from C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/Arduino.h:51,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RadioHead.h:1174,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RHGenericDriver.h:9,
                 from d:\Users\steph\Arduino\libraries\RadioHead/RH_Serial.h:12,
                 from d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:6:
C:\Users\steph\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/HardwareSerial.h:87:7: note:                 class arduino::HardwareSerial
 class HardwareSerial : public Stream
       ^~~~~~~~~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp: In member function 'virtual bool RH_Serial::available()':
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:38:27: error: '_serial' was not declared in this scope
     while (!_rxBufValid &&_serial.available())
                           ^~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:38:27: note: suggested alternative: 'Serial'
     while (!_rxBufValid &&_serial.available())
                           ^~~~~~~
                           Serial
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp: In member function 'virtual bool RH_Serial::send(const uint8_t*, uint8_t)':
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:211:5: error: '_serial' was not declared in this scope
     _serial.write(DLE); // Not in FCS
     ^~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:211:5: note: suggested alternative: 'Serial'
     _serial.write(DLE); // Not in FCS
     ^~~~~~~
     Serial
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp: In member function 'void RH_Serial::txData(uint8_t)':
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:236:2: error: '_serial' was not declared in this scope
  _serial.write(DLE); // Not in FCS
  ^~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:236:2: note: suggested alternative: 'Serial'
  _serial.write(DLE); // Not in FCS
  ^~~~~~~
  Serial
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:237:5: error: '_serial' was not declared in this scope
     _serial.write(ch);
     ^~~~~~~
d:\Users\steph\Arduino\libraries\RadioHead\RH_Serial.cpp:237:5: note: suggested alternative: 'Serial'
     _serial.write(ch);
     ^~~~~~~
     Serial

exit status 1

Compilation error: exit status 1

This is with the latest IDE. Any ideas?

Bipman

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

The problem may be caused by the sketch that you have not posted. Which version of the Radiohead library are you using and is it compatible with the Nano IOT 33 ?

The current version of the RadioHead library (1.121) does not list Arduino Nano 33 as a supported processor.

https://www.airspayce.com/mikem/arduino/RadioHead/

You might be able to work around the error by editing "RH_Serial.h" and "RH_Serial.cpp" to change "HardwareSerial" to "arduino::HardwareSerial".

Aha! That would be why! I don't know why but I never considered it wouldn't be supported. Thanks all.

Bipman

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