RX8010SJ library does not compile

Hello,
i am using ardiono 1.8.19 and the RX8010SJ library >> https://docs.arduino.cc/libraries/rx8010sj/#Releases
when i compile an example for the arduino "FrequencyOutput" i get the following errors:


P:\ORDY-PC\Documents\Arduino\libraries\RX8010SJ-1.0.1\src\RX8010SJ.cpp: In member function 'byte RX8010SJ::Adapter::readFromModule(byte)':
P:\ORDY-PC\Documents\Arduino\libraries\RX8010SJ-1.0.1\src\RX8010SJ.cpp:324:33: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
Wire.requestFrom(i2cAddress, 1);
^
In file included from P:\ORDY-PC\Documents\Arduino\libraries\RX8010SJ-1.0.1\src\RX8010SJ.h:5:0,
from P:\ORDY-PC\Documents\Arduino\libraries\RX8010SJ-1.0.1\src\RX8010SJ.cpp:1:
D:\ORDY\AppData\Local\arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:68:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)
uint8_t requestFrom(int, int);
^~~~~~~~~~~
D:\ORDY\AppData\Local\arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t);
^~~~~~~~~~~
Compiling library "Wire"


and


D:\ORDY\AppData\Local\Temp\arduino_build_600259\libraries\RX8010SJ-1.0.1\main.cpp.o (symbol from plugin): In function setup': (.text+0x0): multiple definition of setup'
D:\ORDY\AppData\Local\Temp\arduino_build_600259\sketch\FrequencyOutput.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\ORDY\AppData\Local\Temp\arduino_build_600259\libraries\RX8010SJ-1.0.1\main.cpp.o (symbol from plugin): In function setup': (.text+0x0): multiple definition of defaultDateTime'
D:\ORDY\AppData\Local\Temp\arduino_build_600259\sketch\FrequencyOutput.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\ORDY\AppData\Local\Temp\arduino_build_600259\libraries\RX8010SJ-1.0.1\main.cpp.o (symbol from plugin): In function setup': (.text+0x0): multiple definition of adapter'
D:\ORDY\AppData\Local\Temp\arduino_build_600259\sketch\FrequencyOutput.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\ORDY\AppData\Local\Temp\arduino_build_600259\libraries\RX8010SJ-1.0.1\main.cpp.o (symbol from plugin): In function setup': (.text+0x0): multiple definition of loop'
D:\ORDY\AppData\Local\Temp\arduino_build_600259\sketch\FrequencyOutput.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Utilisation de la bibliothèque RX8010SJ-1.0.1 version 1.0.1 dans le dossier: P:\ORDY-PC\Documents\Arduino\libraries\RX8010SJ-1.0.1
Utilisation de la bibliothèque Wire version 1.0 dans le dossier: D:\ORDY\AppData\Local\arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
exit status 1
Erreur de compilation pour la carte Arduino Uno


What is the problem?
Thanks for your help

The problem is that the library is 5 years old and either a) the Wire library has been altered in that time in such a way that requires the RX8010SJ library to be updated or b) the compiler had been updated is now checking something much more rigorously now than it did 5 years ago and the RX8010SJ library has to be updated.

Whichever it is, the solution is to bring the RX8010SJ library up to date with the compiler's expectactions and/or the Wire library's needs.

Also... what on earth is main.cpp, with its own setup and loop doing in the src subdirectory of the library??? Has anyone ever even tried to use this thing?

1 Like

Apparently, this file is an example of use that accidentally got into the library code, for practical use it should be removed...

It seems that for all five years not a single real user has tried to compile the library in Arduino IDE :slight_smile:
Created an issue on GitHub.

Try to remove a main.cpp file from the src folder of the library and compile again.

Bravo !! by deleting main.cpp the problem is solved
Thanks for your precious help !

Please mark the topic as "solved"

Just to inform if anyone encounters the RX8010 library problem, after deleting main.cpp visibly in the logs it has problems with the RX8010SJ-0.1.0 library, however the compilation arrives until the end with this error.


RX8010SJ.cpp: In member function 'byte RX8010SJ::Adapter::readFromModule(byte)':
RX8010SJ.cpp:324:33: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
Wire.requestFrom(i2cAddress, 1);

arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:68:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)
uint8_t requestFrom(int, int);

arduino\hardware\avr\1.8.6\libraries\Wire\src/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t);


Which was already addressed back in post #2.

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