MFRC522 library unable to verify/compile (multiple errors)

I wanted to create a scanner that scans a tag with a RFID. In order to do that, I had to download this library by miguelbalboa, but when verifying/compiling the dumpinfo example included with the library:

C:\Users\gzzqh\AppData\Local\Temp\ccuyRqWE.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_DumpInfo.ino.cpp.o.1820':
<artificial>:(.text.startup+0x60): undefined reference to `MFRC522::MFRC522(unsigned char, unsigned char)'
C:\Users\gzzqh\AppData\Local\Temp\ccuyRqWE.ltrans0.ltrans.o: In function `setup':
C:\Users\gzzqh\AppData\Local\Temp\.arduinoIDE-unsaved202506-13152-zbhjfm.9446\DumpInfo/DumpInfo.ino:453: undefined reference to `MFRC522::PCD_Init()'
C:\Users\gzzqh\AppData\Local\Temp\.arduinoIDE-unsaved202506-13152-zbhjfm.9446\DumpInfo/DumpInfo.ino:455: undefined reference to `MFRC522::PCD_DumpVersionToSerial()'
C:\Users\gzzqh\AppData\Local\Temp\ccuyRqWE.ltrans0.ltrans.o: In function `loop':
C:\Users\gzzqh\AppData\Local\Temp\.arduinoIDE-unsaved202506-13152-zbhjfm.9446\DumpInfo/DumpInfo.ino:461: undefined reference to `MFRC522::PICC_IsNewCardPresent()'
C:\Users\gzzqh\AppData\Local\Temp\.arduinoIDE-unsaved202506-13152-zbhjfm.9446\DumpInfo/DumpInfo.ino:466: undefined reference to `MFRC522::PICC_ReadCardSerial()'
C:\Users\gzzqh\AppData\Local\Temp\.arduinoIDE-unsaved202506-13152-zbhjfm.9446\DumpInfo/DumpInfo.ino:471: undefined reference to `MFRC522::PICC_DumpToSerial(MFRC522::Uid*)'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

The code provided by the library I used: here

The board I used for this project is an elegoo mega2560 r3.

We do not chase links, publish all source code in code tags, you did show us the errors. I would have used a more mainstream RFID library, and a mainstream mega2560, sorry elegoo has far too many issues.

Okay sorry, this is my first question. Thank you for your advice!

Yes we tend to get a lot of people saying here that the RFID readers supplied in the elegoo starter kit simply do not work. The solution is normally to buy another RFID reader.

Note that you do need to solder the RFID readers up and not just try and push pins through the holes. Sorry if that is a bit insulting but we have had members who did not realise this.

1 Like

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