-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ATmega4808: Arduino auto-detect libraries finds wrong Servo library -> Error: multiple definition of __vector_25 #167
Comments
No. This is the expected result from the system working as designed: https://arduino.github.io/arduino-cli/latest/sketch-build-process/#dependency-resolution The two libraries have the same score for "architecture matching", "library name", and "folder name" priorities, so the tie-breaker is the "location priority" score:
Something to note is most users will have an additional copy of the global Servo library installed in a separate location. This location has lower priority than the platform bundled library:
This means that after uninstalling the Servo library from the sketchbook folder, a global installation of Servo library would still be available when compiling for other boards without a platform bundled Servo library, while the platform bundled library gets priority when compiling for a MegaCoreX board.
For your GitHub Actions workflow, simple remove As for normal human usage of MegaCoreX, the workaround would be to add a header file with a unique name (e.g., ServoMegaCoreX.h #include <Servo.h> |
Thanks for the link, I searched for it for half an hour, before starting this issue.
This indeed works for me 😀 👍 T H A N K S ! ! ! @MCUdude @ All |
It's all there in the README: |
Thanks for adding ServoMegaCoreX.h 👍 |
I try to compile Servo code for a ATmega4808, as can be found here:
This is the error i get:
I get the same error on my windows Arduino 1.8 and 2.0 IDEs.
The compile error vanishes if I enable
USE_TIMERB1
instead ofUSE_TIMERB2
in the Arduino Servo megaavr/ServoTimers.h file.Do you know any workaround apart from deleting the Arduino Servo library manually?
And what is the use case of having a Servo library not used by Arduino? Or is this an Arduino library detection bug (which will never be fixed, I assume)?
Thanks for caring
Armin
The text was updated successfully, but these errors were encountered: