0

我已逐步按照教程安装 Veins,但是当我尝试运行示例场景(最后一步)时,我最终遇到了上述错误。

整个错误是:

网络设置期间模块 (cModule) RSUExampleScenario (id=1) 出错:找不到类“Veins::ObstacleControl”——可能其代码未链接,或者该类未使用 Register_Class() 注册,或者在模块和通道的情况,使用 Define_Module()/Define_Channel()。

由于 debug-on-errors=true 配置选项,捕获上述异常。你的调试器准备好了吗?

模拟以退出代码终止:-2147483645 工作目录:C:/Users/user/src/veins-4.3/examples/veins 命令行:../../../omnetpp-4.6/bin/opp_run.exe -r 0 -n .;../../src/veins --tkenv-image-path=../../images -l ../../src/veins omnetpp.ini

我认为我在教程中没有错过任何一步,因为我已经尝试了两次。我没有做任何更改,我只是像机器人一样严格遵循教程,所以我无法提供比教程更详细的 MCVE。

这是我正在使用的: - Windows 7 Pro 64 位 - SUMO 0.25.0 64 位

本教程的所有其他步骤都成功运行,直到最后一步。

4

1 回答 1

0

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

于 2016-04-26T08:12:27.550 回答