Replies: 4 comments 2 replies
-
The library developed using PlatformIO and intensively tested for years in Arduino IDE and PlatformIO. You should not get any compilation error by installation library correctly in Arduino ESP8266 and ESP32 platforms. The modification is not needed. Reinstall the library normally using library manager and post any compilation error you get here. |
Beta Was this translation helpful? Give feedback.
-
You should post in this discussion instead. |
Beta Was this translation helpful? Give feedback.
-
I tried several times downloading from the IO library manager, using older versions too and still it failed everytime. Maybe it's my compiler. I just wanted to let everyone know this error in case they get the same message. |
Beta Was this translation helpful? Give feedback.
-
this is the problem I am encountering right now |
Beta Was this translation helpful? Give feedback.
-
The issue
I was having some trouble getting PlatformIO to compile for the ESP32 the user authentication example with mail and password. I was getting some "multiple definition" of some functions inside the library. I was a bit discouraged to find that, despite changing versions of the library, I'd still get the same error.
So, when I finally got to reading and understanding the error, determined to enter the library code, I found that the multiple definitions were on the same file and on the same line. How could it be that is multiply defined if it is defined only once?
My solution
I did a little digging and found out that to get rid of the compilation error you had to either move the code inside the .h files to a .cpp file or add an
inline
tag before the function.Just did that in all methods inside RTDBHelper.h and TokenHelper.h and now it compiles.
My output
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
c:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
getTokenType(token_info_t)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:23: multiple definition of
getTokenType(token_info_t)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:23: first defined herec:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
getTokenStatus(token_info_t)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:49: multiple definition of
getTokenStatus(token_info_t)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:49: first defined herec:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
getTokenError(token_info_t)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:81: multiple definition of
getTokenError(token_info_t)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:81: first defined herec:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
tokenStatusCallback(token_info_t)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:90: multiple definition of
tokenStatusCallback(token_info_t)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/TokenHelper.h:90: first defined herec:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
printResult(FirebaseData&)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/RTDBHelper.h:25: multiple definition of
printResult(FirebaseData&)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/RTDBHelper.h:25: first defined herec:/users/username/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\src\main.cpp.o: in function
printResult(FirebaseStream&)': C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/RTDBHelper.h:133: multiple definition of
printResult(FirebaseStream&)'; .pio\build\esp32doit-devkit-v1\src\FirebaseServer.cpp.o:C:\Users\username\Documents\PlatformIO\Projects\RiegoAutomata_v2/.pio/libdeps/esp32doit-devkit-v1/Firebase Arduino Client Library for ESP8266 and ESP32/src/addons/RTDBHelper.h:133: first defined herecollect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1/
IDE and its version:
Additional context
This is my first time writing an issue in GitHub. I'll see now if I can attach the fixed header files.
Beta Was this translation helpful? Give feedback.
All reactions