安装依赖
sudo apt-get install gcc g++ python python python-dev mercurial bzr valgrind gsl-bin libgsl-dev libgsl2 flex bison libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev uncrustify doxygen graphviz imagemagick python-sphinx dia python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev libboost-signals-dev libboost-filesystem-dev
NS3 build
./waf -d debug --enable-examples --enable-tests configure --disable-werror
在新加的一个CC文件里面,最好在using namespcae ns3;前面添加一个define,具体如下:
NS_LOG_COMPONENT_DEFINE("Myapp");
using namespace ns3;
NS3 调试教程
https://www.nsnam.org/support/faq/running-scripts/
NS3 多个文件
https://www.nsnam.org/support/faq/writing-scripts/
添加第三方库
使用动态连接库的方式添加第三方库
-Wl, --no-as-needed
修改为-Wl, as-needed
http://www.mehic.info/2016/04/installing-and-crypto-libcryptopp-with-ns3/
安装NS3-GYM
参考:https://apps.nsnam.org/app/ns3-gym/
参考代码
https://github.com/caiqiqi/NS3-dev/blob/develop-2016_10_3_meet_gilani/goal-topo.cc
编译教程:https://www.jianshu.com/p/2c6c38ebe936