将脚本放入scratch目录中,如果您运行WAF,它将自动构建
cd ..your filepath
cp examples/tutorial/first.cc scratch/myfirst.cc
sudo ./waf
然后就可以运行了
./waf --run scratch/myfirst
//你可以看到
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (0.418s)
Sent 1024 bytes to 10.1.1.2
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.1.2