cannot find -lplot - fedora
cannot find -lplot - fedora
我在终端上使用sudo yum install gnuplot
安装了gnuplot。我有一个 cpp 文件,它使用 gnuplot。我编译没有错误。在链接时,发生错误。
编译 : g++ -c plot.cpp
友情链接 : g++ -o exe plot.o -lplot
法典:
int main()
{
FILE *pipe = popen("gnuplot -persist", "w");
// set axis ranges
fprintf(pipe,"set xrange [0:11]n");
fprintf(pipe,"set yrange [0:]n");
int b = 5;int a;
// to make 10 points
std::vector<int> x (10, 0.0); // x values
std::vector<int> y (10, 0.0); // y values
for (a=0;a<10;a++) // 10 plots
{
x[a] = a;
y[a] = 2*a;// some function of a
fprintf(pipe,"plot '-'n");
// 1 additional data point per plot
for (int ii = 0; ii <= a; ii++) {
fprintf(pipe, "%d %dn", x[ii], y[ii]); // plot `a` points
}
fprintf(pipe,"en"); // finally, e
fflush(pipe); // flush the pipe to update the plot
usleep(1000000);// wait a second before updating again
}
return 0;
}
添加一个标志-L /where/ever/you/have/the/lib -lplot
以指定libplot.a
所在的位置,如果你需要该库的话。但是,从您的代码来看,您似乎只是将数据输入gnuplot
但不链接到任何libplot.a
。
相关文章:
- cmake如何在fedora工作站中找到boost静态库包
- 如何在 Fedora 上为 C++ 包含 zeromq 标头?
- 致命错误: occi.h: 没有这样的文件或目录 | Fedora 20.
- 60603 (Fedora Cygwin 5.4.0-2) when using std::cout
- 在 Fedora 20 中查找简单设备驱动程序的头文件
- Fedora Linux 中的进程
- qDebug() 在升级到 ubuntu 17.10(和 Fedora)后停止工作(不再打印到控制台)
- Qt上的Fedora V-Play:找不到库
- 在 Fedora 27 中构建 GLFW 时链接期间出错
- 如何在fedora中添加c 中的avcodec.h
- 运行C 程序,其中包含Fedora中的POSIX API
- 尝试解决"out of scope"编译错误:CodeBlocks,Linux Fedora
- 在Fedora 25上的代码块中设置Quantlib
- 将 Fedora 23 上的 C/C++ 编译器降级为 MATLAB R2016a 兼容编译器
- 在Fedora 20 x86_64上编译32位Linux应用程序时,请使用SNDFILE库
- mysql driver for qt database fedora
- 如何使用TCP_QUICKACK Uder Fedora 17.
- 在Fedora Linux上使用C++-gcc
- 在Fedora Linux中运行C++程序
- cannot find -lplot - fedora