简体   繁体   English

在ns3中声明GnuplotHelper失败

[英]Declaring GnuplotHelper failed in ns3

I want to use GnuplotHelper in ns3 to plot the results. 我想在ns3中使用GnuplotHelper绘制结果。 even when I run ns3's default example seventh.cc I get the following error: 即使当我运行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);

If I include " gnuplot-helper.h " I get an additional line and same error: 如果我包含“ gnuplot-helper.h ”,我会得到另外一行和相同的错误:

../scratch/seventh.cc:24:28: fatal error: gnuplot-helper.h: No such file or directory
compilation terminated.

I've installed gnuplot on my linux. 我已经在Linux上安装了gnuplot。 What should I do? 我该怎么办? How can I declare Gnuplot helper? 如何声明Gnuplot助手?

First, did you install a gnu-plot-dev package or just gnuplot? 首先,您是否安装了gnu-plot-dev软件包或只是gnuplot? Many distributions separate the ability to use libraries and the ability to develop against them. 许多发行版将使用库的能力与针对它们的开发能力区分开来。

If you are sure the include files are actually on your system somewhere (check both /usr/include and /usr/local/include/) you may need to add an additional directory level to your compiler search path (perhaps /usr/include/gnuplot/ but I am only guessing there). 如果确定包含文件确实在系统上的某个位置(同时检查/ usr / include和/ usr / local / include /),则可能需要在编译器搜索路径中添加其他目录级别(也许是/ usr / include / gnuplot /,但我只是在猜测)。

尝试

#include "ns3/stats-module.h"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM