我想使用ns3中的GnuplotHelper来绘制结果。即使在运行NS3的默认示例seventh.cc时,也会出现以下错误:
../scratch/congestion.cc: In function ‘int main(int, char**)’:
../scratch/congestion.cc:173:1: error: ‘GnuplotHelper’ was not declared in this scope
GnuplotHelper plotHelper;
^
../scratch/congestion.cc:180:1: error: ‘plotHelper’ was not declared in this scope
plotHelper.ConfigurePlot ("Test","CongestionWindow vs. Time","Time (Seconds)","CongestionWindow","jpg");
^
../scratch/congestion.cc:181:81: error: ‘GnuplotAggregator’ has not been declared
plotHelper.PlotProbe (probeName,probeTrace,"CongetionWindow","CongestionWindow",GnuplotAggregator::KEY_BELOW);
如果包含“gnuplot-helper.h”,则会出现额外的一行和相同的错误:
../scratch/seventh.cc:24:28: fatal error: gnuplot-helper.h: No such file or directory
compilation terminated.
我在Linux上安装了gnuplot。我该怎么办?如何声明Gnuplot助手?
首先,您是安装了gnu-plot-dev包还是只安装了gnuplot?许多发行版将使用库的能力和针对它们进行开发的能力分开。
如果您确信include文件确实在系统中的某个位置(选中/usr/include和/usr/local/include/),您可能需要在编译器搜索路径中添加一个额外的目录级别(可能是/usr/include/gnuplot/,但我只是猜测)。
试试看
#include "ns3/stats-module.h"