1

Veins works fine from Omnet IDE but while trying to run from terminal I get following error:

<!> Error in module (omnetpp::cModule) RSUExampleScenario (id=1) during 
network setup: Class "Veins::ObstacleControl" 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().

I am using the following command

$ cd veins/example/veins_example
$ ../../../../omnet/omnetpp-5.0/bin/opp_run.exe -r 0 -u Cmdenv -n .;../../src/veins --image-path=../../images -l ../../src/veins --debug-on-errors=true omnetpp.ini

Do i need to add anything more?

Sam1324
  • 387
  • 2
  • 13

2 Answers2

2

I found the solution. The ned path included in .ini file for is . but while running the simulation from omnet IDE all ned paths are taken from omnet configuration. After appending all the ned path required in .ini file I am able to run from command line.

Sam1324
  • 387
  • 2
  • 13
1

If you want to find out, what the complete shell command with all necessary variables and paths is, simply start the simulation via the OMNeT++ IDE and take a look at the "Console View". There you will find the run command when you've started a simulation via "Run as -> OMNeT++ Simulation" with all paths and so on.

If you cannot see the "Console View", you can open it via the menu "Window -> Show View -> Other -> General -> Console".

Starting from OMNeT++ 5.0, the IDE will print out the run command so that you can copy it, modify it (e.g., to change from GUI to CmdEnv) and paste it into your shell.

Side node 1: Remember that under Windows you will need to run the command in the mingwenv.cmd environment.

Side node 2: You can also modify your run configuration in the IDE to start your simulation in the CmdEnv from within the IDE... In the run configurations, there's an option to change the user interface...

Michael Kirsche
  • 901
  • 7
  • 14
  • Hi, I am actually copying the command from CmdEnv console and running it in MinGW environment. – Sam1324 Jul 19 '17 at 11:14
  • But the error does not show when you execute your simulation from the IDE (to be run with the graphical TK/TCL user interface)?? What about the case "execute the simulation from the IDE to be run in CmdEnv"?? – Michael Kirsche Jul 19 '17 at 11:47
  • Yes, no error either in CmdEnv or TkEnv. Simulation is fine in both cases, I would like to run the simulation from a script. – Sam1324 Jul 19 '17 at 13:09
  • No idea really, such errors usually show up during the compilation process, not the execution, because the "registration" of modules is done in the source code. – Michael Kirsche Jul 21 '17 at 08:02