返回

为方便读者,本教材中连续四行及以上程序源码(脚本),本网站将直接提供,直接输入使用。

(1)第8页第6行开始12行代码如下:
sudo apt-get -y update 
sudo apt-get -y install ncurses-dev bison flex build-essential 
sudo apt-get -y install libx11-dev libxmu-dev libxmu-headers libxt-dev libtool g++ patch tcl tk tcl-dev tk-dev gnuplot
#降低gcc和g++版本,NS-2无法兼容高版本 
sudo apt -y install gcc-5 g++-5 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30 
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40 
sudo update-alternatives --config gcc 
sudo update-alternatives --config g++ 
(2)第8页倒数第4行到第9页第3行开始7行代码如下:
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse 
deb https://mirrors.aliyun.com/ubuntu/ xenial main 
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main 
deb https://mirrors.aliyun.com/ubuntu/ xenial universe 
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe 
deb http://cz.archive.ubuntu.com/ubuntu bionic main universe 
deb http://mirrors.aliyun.com/ubuntu bionic main universe