c++omnet++wireless

Allocating an object of abstract class type in OMNET ++ define_module


I build OMNET project. The main codes as follow: Routing.h

class  INET_API Routing : public cSimpleModule, public ILifecycle, public cListener {  }

Routing.ned

simple Routing like IManetRouting{  }

Routing.cc

Define_Module(Routing);

When I build the project, the error- Allocating an object of abstract class type Routing.


Solution

  • And this is correct. You cannot create an instance of an abstract class. You MUST implement all the methods defined by ILifecycle and cListener otherwise the behavior of the class is undefined and it is considered abstract.