3
votes

I am writing my own simple modules in omnet++.

Inside the omnet IDE, I have created three simple modules.

After that I have created a "network" using those modules.

It is building successfully, but whenever I try to simulate it it shows

Error in module (cModule) NetworkTopologyOnly (id=1) during network setup: Class "mySimplemodule2" 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().

What should I do to successfully simulate using my own simple modules?

1
Have you built your project?Jerzy D.
The error message is pretty self-explanatory if you keep in mind that an OMNeT++ simulation is the OMNeT++ kernel linked (static or dynamic, just like any binary) with simulation model libraries. Each library will register all its models with the OMNeT++ kernel (this is what the macros mentioned in the error message do). This is what the error message is saying: the factory doesn't know about the model you are trying to instantiate - and it's laying out possible reasons why.Christoph Sommer
@JerzyD. Yes, it is building successfully. But while building a network topology and simulating it, it some simple modules were loaded but this simple module is causing the problem.user3243499
@ChristophSommer : yes but I have used Define_Module(simpleModuleName) in my .cc file. But Why am I still getting this error in the network topology ? However, it is building successfullyuser3243499
Is your own model library linked statically or dynamically? If the former: when launching the simulation, are you sure you are launching the binary you created?Christoph Sommer

1 Answers

1
votes

Other than class or module registering issues, this could also be caused when you have not implemented all its functions (if you have any non-virtual function prototype defined in your omnet++ class).