![](/img/trans.png)
[英]TraciMobility::getExternalId error when adding custom module into Veins_Inet example (Omnet++)
[英]Omnet++ issues running veins_inet example- undefined reference
這個問題類似於Veins_inet: undefined reference to `__imp__ZTVN5Veins17VeinsInetMobilityE' when building in OMNet 5.1.1
在發帖時,我正在運行最新版本的 Veins、Sumo、Omnet 和 Inet。 我創建了一個項目來運行 Venes_inet 示例。 該項目同時引用了 INET 和 Veins。 但是,在運行示例時,我將其作為堆棧跟蹤的一部分:
../out/gcc-release/src/veins_inet/VeinsInetManager.o:VeinsInetManager.cc:(.text+0x63a): undefined reference to `__imp__ZTVN5veins22SignalCallbackListenerIPN7omnetpp7cObjectEEE'
根據堆棧跟蹤,我已經查明了可能的問題,它指的是這段代碼,但我不知道任何解決方案,因為這是源代碼的一部分。
#if INET_VERSION >= 0x0402
signalManager.subscribeCallback(this, TraCIScenarioManager::traciModulePreInitSignal, [this](SignalPayload<cObject*> payload) {
cModule* module = dynamic_cast<cModule*>(payload.p);
ASSERT(module);
// The INET visualizer listens to model change notifications on the
// network object by default. We assume this is our parent.
cModule* root = getParentModule();
auto* notification = new inet::cPreModuleInitNotification();
notification->module = module;
root->emit(POST_MODEL_CHANGE, notification, NULL);
});
在 VEINS 中,src>veins>modules>utility 下有 SignalManager.h,其中包含來自上述代碼的引用。
class VEINS_API SignalCallbackListener
除此之外,我覺得我已經用盡了所有可能的解決方案和探索。
編輯:我可以毫無錯誤地構建 INET 和 Veins。
我正在運行 Veins 和 Inet 的不穩定版本。 更新這些解決了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.