问题
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:
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:
- Use the
.run
as executable from your examples directory, which callsveins/run
and includes all the required libraries:
- Use
opp_run
as executable and set dynamic libraries to the directory wherelibveins.so
is located (usuallysrc/veins
)
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
来源:https://stackoverflow.com/questions/36085585/class-veinsobstaclecontrol-not-found