ModuleMixin: export the internal helpers from the library - #1149
Open
mustafatopsakal wants to merge 1 commit into
Open
ModuleMixin: export the internal helpers from the library#1149mustafatopsakal wants to merge 1 commit into
mustafatopsakal wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two helpers in
namespace internalare used by theModuleMixin<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 withINET_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