在终端执行以下命令
- 进入indep-utils下的propagation文件夹
- 编译程序
$cd /Documents/ns/ns-2.35/indep-utils/propagation/
$g++ -lm threshold.cc -o threshold
报错"threshold.cc:56:22: fatal error: iostream.h: 没有那个文件或目录"
在threshold.cc文件中
将#include<iostream.h>
修改为#include<iostream>
,- 添加命令空间std,代码为
using namespace std;
- 添加,#include<string.h>
再次使用编译
$g++ -lm threshold.cc -o threshold
未报错,则编译成功。
执行以下命令
./threshold -m TwoRayGround 250