Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
986 views
in Technique[技术] by (71.8m points)

omnet++ - 我在OMNET ++项目中无法理解的错误(Error i cant understand in my OMNET++ project)

I'm in the middle of my omnetpp project and it gives me this error in runtime:

(我在omnetpp项目的中间,它在运行时给我这个错误:)

terminate called after throwing an instance of 'omnetpp::cRuntimeError' what(): (omnetpp::cModule): Object has no associated cComponentType (maybe omnetpp::cModule is not derived from cModule/cChannel?)

(引发'omnetpp :: cRuntimeError'实例后终止调用what():(omnetpp :: cModule):对象没有关联的cComponentType(也许omnetpp :: cModule并非源自cModule / cChannel?))

I think the problem is the source file because the ned file is pretty simple and works with other .cc files but maybe it is the combination of the two.

(我认为问题在于源文件,因为ned文件非常简单,并且可以与其他.cc文件一起使用,但也许是两者的结合。)

This is the first part of the .cc file:

(这是.cc文件的第一部分:)

using namespace omnetpp;


class Nodo_centrale;
class Sensore;


class Net : public cSimpleModule
{
   std::unique_ptr<Nodo_centrale> NodoCentrale;
   std::unique_ptr<Sensore> Sensore1;
   std::unique_ptr<Sensore> Sensore2;
public:
// The following redefined virtual function holds the algorithm.
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;

};
Define_Module(Net);

And then I declared the 2 classes (Sensore, Nodo_centrale).

(然后我声明了两个类(Sensore,Nodo_centrale)。)

The ned file is the following:

(该文件如下:)

simple Net
{
parameters:

    @display("i=block/routing");
 gates:
    inout gate[];
 }

 network Nodes
 {
 types:
    channel Channel extends ned.DelayChannel {
        delay = 100ms;
    }
 submodules:
    Node[3]: Net;
 connections:
    Node[0].gate++ <--> Channel <--> Node[1].gate++;
    Node[0].gate++ <--> Channel <--> Node[2].gate++;

  }
  ask by Wolz translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

[1] html - How to create even cell spacing within a

2.1m questions

2.1m answers

60 comments

57.0k users

...