Class “Veins::ObstacleControl” not found

陌路散爱 提交于 2019-12-13 05:37:17

问题


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:

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

  1. Use opp_run as executable and set dynamic libraries to the directory where libveins.so is located (usually src/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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!