Compile errors using rc-switch

I get an error when I try to compile an example from the rc-switch library.

ReceiveDemo_Simple:15:12: error: 'class RCSwitch' has no member named 'enableReceive'

I have tried various releases of the rc-switch library but I always get the same error.
Has anyone got any ideas why this error occurs?

  Simple example for receiving

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2

void loop() {
  if (mySwitch.available()) {
    int value = mySwitch.getReceivedValue();
    if (value == 0) {
      Serial.print("Unknown encoding");
    } else {
      Serial.print("Received ");
      Serial.print( mySwitch.getReceivedValue() );
      Serial.print(" / ");
      Serial.print( mySwitch.getReceivedBitlength() );
      Serial.print("bit ");
      Serial.print("Protocol: ");
      Serial.println( mySwitch.getReceivedProtocol() );


What do you have selected in the Tools > Board menu?

I selected:

Board "ATtiny25/45/85"
Chip "ATtiny85"
Clock "8MHz(internal)"

I think this is right?

I get no errors when I compile using a transmit sketch with the ATtiny85 and rc-switch. As the transmit side in my project requires a small and low low power unit whereas the receive side has none of those limitations, I will use a nano or mega, both of which produce no compilation errors for the receive sketch with rc-switch.

I will leave this receive side compilation problem using an ATtiny85 and rc-switch for others to solve if they wish.

From the library source code:

// At least for the ATTiny X4/X5, receiving has to be disabled due to
// missing libm depencies (udivmodhi4)
#if defined( __AVR_ATtinyX5__ ) or defined ( __AVR_ATtinyX4__ )
#define RCSwitchDisableReceiving
    #if not defined( RCSwitchDisableReceiving )
    void enableReceive(int interrupt);

So you can see that all the receiving functions are automatically disabled in the library when you are compiling for the ATtiny85. This is why you got the error. The library was intentionally written this way but unfortunately the library author didn't bother to document it. I have now added a note about this to the library's documentation:

Thanks Pert,

That clears that issue up.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!

I am getting similar errors running arduino pro micro, went to where pert said he updated the descriptions in the library and could not find the information. Not sure how to uncomment/enable receiving functions specifically for arduino in the RC-Switch library; and not raspberrypi or one of the other platforms described in that library. Please help