ns just got an Elegoo UNO starter kit the various other day and have been functioning my way through the little tutorials on all the components it came with. Ns am using VSCode v Platform.io plugin and (after getting it set up) it has actually been functioning nicely.

The code I am right now struggling v is a sketch that is an alleged to use the IR Remote and Receiver the kit came with, i keep obtaining the error: collect2.exe: error: ld reverted 1 departure status

I have actually done part looking roughly online yet haven"t had actually much luck obtaining anything come work.

My complete code is below:

char foo;#include #include #include #include IRrecv irrecv(RECEIVER); // produce instance that "irrecv"decode_results results; // develop instance of "decode_results"void setup() Serial.begin(9600); Serial.println("IR Receiver button Decode"); irrecv.enableIRIn();void loop(){ int tmpValue; if (irrecv.decode(&results)) // have actually we received an IR signal? because that (int i = 0; ns This is password that was included with the tutorials, but I to be not details it is airtight together I have already had to perform some tweaking that the code and also header files consisted of with the device.The error ns am obtaining is the following:

include/IR.h:29:0: warning: "REPEAT" redefined #define REPEAT 22 ^In record included from srcmain.cpp:4:0:include/IRremote.h:57:0: note: this is the location of the previous meaning #define REPEAT 0xffffffff ^In file included from srcmain.cpp:6:0:include/IR.h:36:78: warning: initializer-string for range of chars is too lengthy <-fpermissive> "UP","EQ","ST/REPT","0","1","2","3","4","5","6","7","8","9"; ^Linking .piouildunofirmware.elfC:UserswileyAppDataLocalTempccDVm6mB.ltrans0.ltrans.o: In duty `global constructors keyed come 65535_0_main.cpp.o.1820"::(.text.startup+0x60): undefined reference to `IRrecv::IRrecv(int)"C:UserswileyAppDataLocalTempccDVm6mB.ltrans0.ltrans.o: In role `main"::(.text.startup+0x160): undefined referral to `IRrecv::enableIRIn()":(.text.startup+0x16c): undefined recommendation to `IRrecv::decode(decode_results*)":(.text.startup+0x1c6): undefined reference to `IRrecv::resume()"collect2.exe: error: ld reverted 1 leave status*** <.piouildunofirmware.elf> Error 1I don"t know the errors the is informing me are in the IR.h file. It claims that REPEAT is redefined yet it only characterized once in the file. In regards come the undefined recommendation to IRrecv:: ns dont understand, due to the fact that I have actually all the encessary files in the "Include" folder, and also when i CTRL click those attributes in the editor it takes me to the files and also shows me the code... Therefore why can"t it discover the code when I operation it?

IR.h:

#ifndef _IR_H#define _IR_H#define receiver 11#define KEY_POWER (0xFFA25D)#define KEY_FUNC_STOP (0xFFE21D)#define KEY_VOL_ADD (0xFF629D)#define KEY_FAST_BACK (0xFF22DD)#define KEY_PAUSE (0xFF02FD)#define KEY_FAST_FORWARD (0xFFC23D)#define KEY_DOWN (0xFFE01F)#define KEY_VOL_DE (0xFFA857)#define KEY_UP (0xFF906F)#define KEY_EQ (0xFF9867)#define KEY_ST_REPT (0xFFB04F)#define KEY_0 (0xFF6897)#define KEY_1 (0xFF30CF)#define KEY_2 (0xFF18E7)#define KEY_3 (0xFF7A85)#define KEY_4 (0xFF10EF)#define KEY_5 (0xFF38C7)#define KEY_6 (0xFF5AA5)#define KEY_7 (0xFF42BD)#define KEY_8 (0xFF4AB5)#define KEY_9 (0xFF52AD)#define KEY_REPEAT (0xFFFFFFFF)#define KEY_NUM 21#define REPEAT 22unsigned lengthy keyValue<>=KEY_POWER,KEY_FUNC_STOP,KEY_VOL_ADD,KEY_FAST_BACK,KEY_PAUSE,KEY_FAST_FORWARD, KEY_DOWN,KEY_VOL_DE,KEY_UP,KEY_EQ,KEY_ST_REPT,KEY_0,KEY_1,KEY_2,KEY_3,KEY_4,KEY_5, KEY_6,KEY_7,KEY_8,KEY_9,KEY_REPEAT;char keyBuf<><10>="POWER","FUNC/STOP","VOL+","FAST BACK","PAUSE","FAST FORWARD","DOWN","VOL-", "UP","EQ","ST/REPT","0","1","2","3","4","5","6","7","8","9";#endifI have actually searched digital a lot, and also this appears to be a usual issue through this IR.h library, and none of the fixes proposed have gained me anywhere.


You are watching: Collect2 exe error ld returned 1 exit status


See more: The Reservoir In The Kidney That Collects The Urine Is The, Renal System

(I obtain the exact same outputs as soon as trying to operation this lay out within the allisonbrookephotography.com principle with every a libraries installed)

I have actually been developing with Java and also Python for a if now, yet I have practically no suffer with C or C++ prior to the allisonbrookephotography.com, so maybe this is a an easy error I just don"t understand. Super frustrating!! Any assist or guidance would be appreciated! Thanks