Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

Uncommenting DMOD_ENABLE_REGISTRATION in main.c caused multiple definition linker errors. The root cause: dmlist.c unconditionally defined DMOD_ENABLE_REGISTRATION, creating duplicate registration structs when main.c also defined it before including dmlist.h.

Changes

  • lib/dmlist/src/dmlist.c: Apply same guard pattern as dmod_system.c:

    #ifndef DMOD_EXTERNAL_REGISTRATION
    #   define DMOD_ENABLE_REGISTRATION
    #endif
  • lib/CMakeLists.txt: Pass DMOD_EXTERNAL_REGISTRATION compile definition to dmlist target when enabled

  • src/main.c: Uncomment DMOD_ENABLE_REGISTRATION to enable the feature

Note

The dmlist submodule commit needs to be pushed upstream to choco-technologies/dmlist before CI will pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>Rozwiązać problem linkowania z DMOD_ENABLE_REGISTRATION</issue_title>
<issue_description>Jak się odkomentuje DMOD_ENABLE_REGISTRATION w main.c to z jakiegoś powodu widzi wiele definicji rejestracji. Trzeba ustalić przyczynę i rozwiązać problem, aby można było to odkomentować i żeby rejestracje dmlist były widziane przez dmod</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 30, 2025 14:42
- Modified dmlist.c to use DMOD_EXTERNAL_REGISTRATION guard
- Uncommented DMOD_ENABLE_REGISTRATION in main.c

When DMOD_EXTERNAL_REGISTRATION is defined (as in dmboot), dmlist.c
will not define DMOD_ENABLE_REGISTRATION, avoiding multiple definition
errors. Registration is handled by main.c instead.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
- Pass DMOD_EXTERNAL_REGISTRATION compile definition to dmlist target
- Update dmlist submodule with guard to prevent multiple registrations

This enables main.c to handle all registrations when DMOD_ENABLE_REGISTRATION
is defined, avoiding multiple definition linker errors.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix linking issue with DMOD_ENABLE_REGISTRATION Fix DMOD_ENABLE_REGISTRATION multiple definition linker errors Nov 30, 2025
Copilot AI requested a review from JohnAmadis November 30, 2025 14:50
@JohnAmadis JohnAmadis closed this Nov 30, 2025
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

Successfully merging this pull request may close these issues.

Rozwiązać problem linkowania z DMOD_ENABLE_REGISTRATION

2 participants