此问题类似于Veins_inet:在OMNet 5.1.1中构建时,对'__imp__ZTVN5Veins17VeinsInetMobilityE'的未定义引用
发布时,我正在运行Veins,Sumo,Omnet和Inet的最新版本。我创建了一个项目来运行静脉s_inet示例。该项目同时引用了INET和静脉。但是,在运行示例时,我将其作为堆栈跟踪的一部分:
../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和静脉。
我当时正在运行不稳定的静脉和Inet版本。更新这些可以解决问题。