微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

运行时错误:也许未链接其代码,或者未在Register_Class/ Define_Module/ Define_Channel中注册该类?

如何解决运行时错误:也许未链接其代码,或者未在Register_Class/ Define_Module/ Define_Channel中注册该类?

我已经声明了Define_Module(veins :: TraCIDatedissemination),并通过了各种建议,但再次收到此错误。任何建议都欢迎。请帮忙。

How to register a new class (new application) in Omnet++ Error in module during network setup: Class "simpleModule" not found in omnetpp https://doc.omnetpp.org/omnetpp/manual/

在手册中,我检查了-

7.12.3 Class Registration
You should also use the Register_Class() macro to register the new class. It is used by the createOne() factory function,which can create any object given the class name as a string. createOne() is used by the Envir library to implement omnetpp.ini options such as rng-class="..." or scheduler-class="...". (see Chapter [17])

但无法理解。请帮助。

A runtime error occurred:

Class "TraCIDatadissemination" not found -- perhaps its code was not linked in,or the class wasn't registered with Register_Class(),or in the case of modules and channels,with Define_Module()/Define_Channel() -- in module (omnetpp::cModule) RSUExampleScenario.node[0] (id=13),at t=1s,event #2

Launch a debugger with the following command?

nemiver --attach=20070 &

OMNET.INI

##########################################################
#                      App Layer                         #
##########################################################
#*.node[*].appltype = "TraCIDemo11p"
*.node[*].appltype = "TraCIDatadissemination"
*.node[*].appl.headerLength = 80 bit

TraCIDatadissemination.h

namespace veins {

class TraCIDatadissemination : public DemoBaseApplLayer {
public:
{
//my code
}
}

TraCIDatadissemination.cc

#include "veins/modules/application/traci/TraCIDatadissemination.h"
#include<math.h>
using namespace veins;

Define_Module(veins::TraCIDatadissemination);

//code

TraCIDatadissemination.ned

   package org.car2x.veins.modules.application.traci;
    import org.car2x.veins.modules.application.ieee80211p.DemoBaseApplLayer;
    
    simple TraCIDatadissemination extends DemoBaseApplLayer
    {
    
        @class(TraCIDatadissemination);
        @display("i=block/app2");
}

请帮助!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。