0

I've compiled successfully a year ago in Arduino IDE, but lately I'm getting fatal errors:

/Users/davidjeffers/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.cpp: At global scope:
/Users/davidjeffers/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.cpp:473:8: error: redefinition of 'size_t PubSubClient::write(uint8_t)'
size_t PubSubClient::write(uint8_t data) {
^
In file included from /Users/davidjeffers/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.cpp:7:0:
/Users/davidjeffers/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.h:160:19: error: 'virtual size_t PubSubClient::write(uint8_t)' previously defined here
virtual size_t write(uint8_t) {};
^

I've tried using VSCode. I've tried opening an issue on GitHub.

Thanks for any thoughts.

Juraj
18.3k4 gold badges31 silver badges49 bronze badges
asked Apr 20, 2020 at 17:05
2
  • reinstall the library Commented Apr 20, 2020 at 18:17
  • 1
    @Juraj - That works. Why? Commented Apr 20, 2020 at 18:40

1 Answer 1

0

The library is somehow modified. There should be no {} in virtual size_t write(uint8_t) {}; or the whole line shouldn't be in this .h.

Reinstall the library.

answered Apr 21, 2020 at 5:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.