【问题标题】:Omnet++ issues running veins_inet example- undefined referenceOmnet++ 运行 Venes_inet 示例时出现问题 - 未定义参考
【发布时间】:2020-06-06 14:16:17
【问题描述】:

这个问题类似于 Veins_inet:在 OMNet 5.1.1 中构建时对“__imp__ZTVN5Veins17VeinsInetMobilityE”的未定义引用

在发帖时,我正在运行最新版本的 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。

【问题讨论】:

    标签: c++ omnet++ veins inet sumo


    【解决方案1】:

    我正在运行 Veins 和 Inet 的不稳定版本。更新这些解决了问题。

    【讨论】:

    • 感谢分享解决方案。是的,使用正确版本的 Veins 和 INET 很重要。请参阅veins.car2x.org/download 以获取相互兼容的版本列表。从 Veins 5.0 开始,您还可以在命令行上运行其./configure 脚本来为您检查。
    猜你喜欢
    • 2011-10-30
    • 1970-01-01
    • 2021-03-31
    • 2015-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多