我正在尝试实施在 NS3 中创建新协议标头的标准建议。我一直在关注http://www.nsnam.org/wiki/HOWTO_create_a_new_type_of_protocol_header_or_trailer上的简短教程。
即使只是将代码复制到相关文件中,我也会收到错误提示 SetData 和 GetData 未定义。
./libns3.21-applications-debug.so: undefined reference to
ns3::LocHeader::GetData() const'./libns3.21-applications-debug.so: undefined reference to
vtable for ns3::LocHeader'
./libns3.21-applications-debug.so: undefined reference to
ns3::LocHeader::SetData(unsigned int)'clang: error: linker command failed with exit code 1 (使用 -v 查看调用)`
我在任何示例代码中都没有看到 SetData() 或 GetData() 的函数定义。我应该自己编写代码吗?似乎这将包含在示例代码中。