Skip to content

ModuleMixin: export the internal helpers from the library - #1149

Open
mustafatopsakal wants to merge 1 commit into
inet-framework:masterfrom
mustafatopsakal:fix-modulemixin-export
Open

ModuleMixin: export the internal helpers from the library#1149
mustafatopsakal wants to merge 1 commit into
inet-framework:masterfrom
mustafatopsakal:fix-modulemixin-export

Conversation

@mustafatopsakal

@mustafatopsakal mustafatopsakal commented Aug 31, 2026

Copy link
Copy Markdown

Two helpers in namespace internal are used by the ModuleMixin<T> class template but are not exported from the library, so code outside INET that derives from an INET module class does not link on Windows. This marks both the declarations and the definitions with INET_API.

Architectural surface: none. No contract, packet content, configuration parameter, NED interface or feature descriptor changes. The change affects symbol visibility only; behavior inside INET is unchanged, since those calls already resolved locally.

Tests: the INET test suite was not run, as the change cannot alter simulation behavior. Verified by build and link on Windows with INET 4.7.0 and OMNeT++ 6.3.0: before the change an external project that derives from an INET module class fails with the two undefined symbols; after rebuilding the library the same project links and its simulation runs. Not verified on Linux, where the default symbol visibility would plausibly hide the problem.

Fixes #1137


Devin Review

Code outside the INET library that derives from an INET module class fails to link on Windows:

    ld.lld: error: undefined symbol: inet::internal::refreshDisplayString(omnetpp::cModule*, inet::StringFormat::IResolver const*)
    ld.lld: error: undefined symbol: inet::internal::doResolveExpression(omnetpp::cModule*, char const*)

Both helpers are called from the ModuleMixin<T> class template, so the calls are instantiated in the consumer's translation unit, but the symbols are not exported from the shared library. Inside INET the calls resolve locally, which is why the failure appears only outside it.

Marking only the declarations is not sufficient, because ModuleMixin.cc does not include ModuleMixin.h; the consumer error then becomes an unresolved __declspec(dllimport) symbol and the link still fails. Adding the include would be the alternative, but marking both sides keeps the export explicit at the point of declaration.

INET_API is already reachable in ModuleMixin.cc through StringFormat.h, so no new include is needed.

Fixes inet-framework#1137

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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.

ModuleMixin helpers are not exported from libINET.dll on Windows (INET 4.7.0)

1 participant