我正在尝试在ubuntu机器上执行基于c的绘图程序,但它显示错误。我已经附上了我的代码和输出谢谢你
这是我用于矢量绘图的c语言代码 Plotingvector.c
#include <apop.h>
void plot_matrix_now(gsl_matrix *data)
{
static FILE *gp = NULL;
if (!gp)
gp = popen("gnuplot -persist", "w");
if (!gp)
{
printf("Couldn't open Gnuplot.\n");
return;
}
fprintf(gp,"reset; plot '-' \n");
apop_matrix_print(data, .output_pipe=gp);
fflush(gp);
}
int main()
{
apop_db_open("data-climate.db");
plot_matrix_now(apop_query_to_matrix("select (year*12+month)/12., temp from temp"));
}
以下是编译程序的命令:
gcc -std=gnu99 Plotingvector.c -o Plotingvector.out -lapophenia -lgsl -lsqlite3
错误: -
/tmp/ccs0P974.o: In function `main': Plotingvector.c:(.text+0xd6): undefined reference to `apop_query_to_matrix'
collect2: error: ld returned 1 exit status