c++ - 在 NS3 中构建 Aquasim 模块的问题
问题描述
构建 aquasim 时出现以下错误
In file included from ./ns3/object-base.h:23:0,
from ./ns3/object.h:29,
from ./ns3/energy-source.h:30,
from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:21:
./ns3/type-id.h: In instantiation of ‘static ns3::ObjectBase* ns3::TypeId::AddConstructor()::Maker::Create() [with T = ns3::AquaSimEnergyModel]’:
./ns3/type-id.h:659:3: required from ‘ns3::TypeId ns3::TypeId::AddConstructor() [with T = ns3::AquaSimEnergyModel]’
../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:42:42: required from here
./ns3/type-id.h:656:27: error: invalid new-expression of abstract class type ‘ns3::AquaSimEnergyModel’
ObjectBase * base = new T ();
^~~~~~~~
In file included from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:26:0:
../src/aqua-sim-ng/model/aqua-sim-energy-model.h:45:7: note: because the following virtual functions are pure within ‘ns3::AquaSimEnergyModel’:
class AquaSimEnergyModel : public DeviceEnergyModel
^~~~~~~~~~~~~~~~~~
In file included from ./ns3/device-energy-model-container.h:26:0,
from ./ns3/energy-source.h:34,
from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:21:
./ns3/device-energy-model.h:106:16: note: virtual void ns3::DeviceEnergyModel::HandleEnergyChanged()
virtual void HandleEnergyChanged (void) = 0;
^~~~~~~~~~~~~~~~~~~
Waf: Leaving directory `/home/udit/ns-allinone-3.30.1/ns-3.30.1/build'
Build failed
-> task in 'ns3-aqua-sim-ng' failed with exit status 1 (run with -v to display more information)
解决方案
尝试根据此构建 ns3,https: //www.nsnam.org/wiki/HOWTO_build_old_versions_of_ns-3_on_newer_compilers
或者请提供您的 NS3 版本和 GCC 编译器的更多详细信息。
推荐阅读
- c - 从C中的输入值中找到奇数的阶乘
- cypress - 使用 cypress 查看网页证书
- c# - 使用 Windows 窗体将 C# 连接到 mySQL 数据库
- python - 如何仅使用我的 df 中的日期而不是所有日期进行绘图
- json - 如果我传递一个将在 Swift/Obj-C 中返回 JSON 的对象,如何创建一个通用类和函数?
- swift - SwiftUI:如何打开字体选择器?
- excel - 计算电力支点的月效率
- uwp - UWP:滚动 ListView 以专注于项目
- angular - 使用 OnPush 在 push/removeAt 后更新 Angular FormArray 内容
- c++ - 如何在 Windows 上为 CLion 添加 OpenGL 和 GLUT?