Skip to content

Unexpected problem-causing definition of initVariant() #52

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

Closed
Sergio-Slobodrian opened this issue Nov 5, 2024 · 2 comments
Closed

Unexpected problem-causing definition of initVariant() #52

Sergio-Slobodrian opened this issue Nov 5, 2024 · 2 comments

Comments

@Sergio-Slobodrian
Copy link

When attempting to use initVariant in a library I'm creating for the Arduino Nano Every I was getting linker errors about multiple definitions of the initVariant function which is weakly defined in main.cpp specifically so it can be defined elsewhere.

The issue is the following. At the bottom of the file: .arduino15/packages/arduino/hardware/megaavr/1.8.8/variants/nona4809/variant.c an apparently random definition of the initVariant() function exists. It's empty and it's the last function in the file with no comments as to why it's there.

The file came with the download when the board was defined.

The board was defined as follows:
Arduino megaAVR Boards by Arduino Version 1.8.8 INSTALLED
Boards included in this package:
Arduino UNO WiFi Rev2, Arduino Nano Every

I selected the 4809 version.

The fix is simple, remove the function from the file. It shouldn't be there as an empty shell anyway and prevents the initVariant function from being used for its intended purpose. I just commented it out in the file for now but it would be nice to not have to go find and comment it out for each future upgrade.

@per1234
Copy link

per1234 commented Nov 5, 2024

Hi @Sergio-Slobodrian. That variant.c file is not part of this repository's codebase so this is not the appropriate place to report the issue.

@Sergio-Slobodrian
Copy link
Author

Ok, I'll try to find out what repository it belongs to and report it there. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants