NS3编译运行

程序前面导入的头文件(也是一系列的头文件组合在一起的模块头文件)放在../build/debug/ns3/ 下面。

 

首先介绍一种最简单允许 examples 和 tests的方法:
$./waf configure --enable-examples --enable-tests
$./waf build

1.当一次使用 build.py 运行
禁止:  $ ./build.py
允许:   $ ./build.py --enable-examples --enable-tests
2.第一次使用 waf 运行build
禁止: 
$./waf configure
$./waf build
允许:
$./waf configure --enable-examples --enable-tests
$./waf build

 

有一个文件记录了默认的配置信息,可以修改它的默认参数,即默认的是激活examples and tests 还是锁死:

文件名叫utils/ .ns3rc文件  $ vim .ns3rc

禁止: # Set this equal to true if you want examples to be run.
examples_enabled = False

# Set this equal to true if you want tests to be run.
tests_enabled = False

允许:
# Set this equal to true if you want examples to be run.
examples_enabled = True

# Set this equal to true if you want tests to be run.
tests_enabled = True

配置好运行环境后,就可以用以下方式运行:

./waf --run  yourprogram    //yourprogram.cc

./waf --pyrun yourprogram.py

debug 程序:

./waf --run yourProgram --command-template="gdb %s"

编译好的可执行文件放在.../debug/example/...相应的目录里,自己可以查看到

自己写好的程序放在scratch/目录下就可以直接运行了,放在其它目录下运行程序的配置我了不会啊,

也没有找到相关方面的资料,有知道的提供下资料或连接,学习后可以补上。

转载于:https://www.cnblogs.com/lovemo1314/archive/2011/12/23/2298906.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值