0
votes

I have followed step by step the tutorial to install Veins, but when I tried running the example scenario (final step) I ended up with the above error.

The whole error was:

Error in module (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().

TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?

Simulation terminated with exit code: -2147483645 Working directory: C:/Users/user/src/veins-4.3/examples/veins Command line: ../../../omnetpp-4.6/bin/opp_run.exe -r 0 -n .;../../src/veins --tkenv-image-path=../../images -l ../../src/veins omnetpp.ini

I don't think I have missed a step during the tutorial as I have tried it two times. I did not make any change in anything, I've just strictly followed the tutorial like a robot, so I cannot provide an MCVE with more details than the tutorial.

Here is what I'm using: - Windows 7 Pro 64 bits - SUMO 0.25.0 64 bits

All other steps of the tutorial successfully worked until the final step.

1
Can you verify that out/*/src/veins/modules/obstacle/ObstacleControl.o is indeed present and has been linked into libveins.dll? You can also try running opp_run -l src/veins -h classes and see if Veins::ObstacleControl appears in the list.Christoph Sommer

1 Answers

0
votes

I assume this error occurs when running Veins via the OMNeT++ IDE. Or, if you have compiled it with GCC (The error does not happen if you use CLANG)

There are two ways to bypass this error:

  1. Use the .run as executable from your examples directory, which calls veins/run and includes all the required libraries:

enter image description here

  1. Use opp_run as executable and set dynamic libraries to the directory where libveins.so is located (usually src/veins)

enter image description here

PS: to answer @ChristopSommer questions: Veins::ObstacleControl appears in opp_run -l src/veins -h classes

This could be a solution too, but I never tested it: Compiler flags in Eclipse