首页 > 解决方案 > 在 omnet++ 中构建 INET 时出错

问题描述

我在 Ubuntu 上工作,我已经安装了模拟器 omnet++ 5.3 的最新版本。我已经下载了 INET Framework 3.6.4 并在 omnet++ 上导入它后,在构建它时出现错误,即:

inet/common/geometry/common/CoordinateSystem.cc:21:10: fatal error: osgEarthUtil/ObjectLocator: No such file or directory #include <osgEarthUtil/ObjectLocator> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [../out/gcc-release/src/inet/common/geometry/common/CoordinateSystem.o] Error 1 Makefile:1330: recipe for target '../out/gcc-release/src/inet/common/geometry/common/CoordinateSystem.o' failed make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/home/noelia/Downloads/inet/src' Makefile:6: recipe for target 'all' failed make: *** [all] Error 2

你知道为什么会这样吗?或者如果是版本问题?如何包含丢失的文件?

标签: ubuntuomnet++inet

解决方案


使用 Ubuntu 18.04,我已经能够按照torokati44 的 "cherry-picking" 毫无错误地构建 INet 。他的帖子链接到这个提交。以下是我执行的步骤:

  1. 下载INet的最新开发版本(即 inet-3.99.3);
  2. 如果您在 OMNeT 中安装了 INet,请启动 OMNeT 并在项目资源管理器中删除 inet。选中“删除磁盘上的项目内容(无法撤消)”或从 OMNeT 中的项目资源管理器层次结构中删除后将inet 文件夹移至其他位置;
  3. 将步骤1)下载的inet解压,并将其放在与步骤2)中删除的相同的位置;
  4. 用 torokati44 提交的 fccb335 中的文件替换 4 个文件(见上文)。我建议您使用“.bak”扩展名重命名文件,而不是删除/替换它们,以防万一;
  5. 在 OMNeT 中,导入新的 inet(文件 > 导入... > 常规 > 现有项目到工作区)。不要将项目复制到工作区中,因为 INet 已在步骤 3) 中移动到工作区中;
  6. 您应该能够构建 INet,它有望工作。

希望这对你有用!干杯。


推荐阅读