简体   繁体   English

Ns3 添加一个新模块——gcc 没有找到包含的头文件

[英]Ns3 adding a new module— gcc not finding included headers

I am trying to add a new custom module to NS3 Network Simulator 3 and I am having trouble making the header files of the module visible to the compiler.我正在尝试向 NS3 Network Simulator 3添加一个新的自定义模块,但无法使编译器看到该模块的头文件。

Here is what I did:这是我所做的:

1.I followed this guide to add a new noc module using the createModule script. 1.我按照本指南使用 createModule 脚本添加了一个新的 noc 模块。

2.I went on and copied my module files into the new created noc directory and made waf(the build system ns3 uses) aware of my new files through editing the wscript file. 2.我继续将我的模块文件复制到新创建的 noc 目录中,并通过编辑 wscript 文件使 waf(构建系统 ns3 使用)知道我的新文件。

3.It is my understanding that with all this set up(I probably wrong) that with this set up,running the waf commands to rebuild ns3 should rebuild ns3 with my new module. 3.根据我的理解,所有这些设置(我可能错了),在这个设置下,运行 waf 命令来重建 ns3 应该用我的新模块重建 ns3。

To build I give the following commands:要构建我给出以下命令:

  ./waf clean

  ./waf configure --enable examples

  ./waf build

The system goes on and builds ns3 and when it gets to my noc module it throws errors about objects of a Scalar Class not being defined in the scope.This usually means that I haven't included the header files but I have tried to copy them with other module files and included them with statements like #include "nstime.h" .With this the problem persisted.系统继续构建 ns3,当它到达我的 noc 模块时,它会抛出有关未在范围中定义的标量类的对象的错误。这通常意味着我没有包含头文件,但我试图复制它们与其他模块文件,并将它们包含在 #include "nstime.h" 之类的语句中。这样问题仍然存在。 I tried copying the header with the definition of my class in the /usr/include directory and inlcuded it with #include and the problem is still there.我尝试在 /usr/include 目录中复制带有我的类定义的标题,并将其包含在 #include 中,但问题仍然存在。

I realize this is a long post ,I am sorry but I would really appreciate it if somebody helped point out what I am missing.Thank you for your time.我意识到这是一篇很长的文章,很抱歉,但如果有人帮助指出我遗漏的内容,我将不胜感激。谢谢您的宝贵时间。

你也应该确保在你的文件的WScript您在模块的依赖关系添加到其他的NS-3模块作为解释在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM