I am trying to plot a graph in C and tested this code:
#include <stdio.h>
#include <stdlib.h>
#include "pbPlots.h"
#include "supportLib.h"
int main()
{
double x[] = {-1, 0, 1, 2, 3, 4, 5, 6};
double y[] = {-5, -4, -3, -2, 1, 0, 1, 2};
RGBABitmapImageReference *imageRef = CreateRGBABitmapImageReference();
DrawScatterPlot(imageRef, 600, 400, x, 8, y, 8);
size_t length;
double *pngData = ConvertToPNG(&length, imageRef->image);
WriteToFile(pngData, length, "plot.png");
}
pbPlots.c/.h and supportLib.c/.h are in the same folder with my C file.
My OS is Ubuntu 20.04.
When I try to run i get this output:
undefined reference to CreateRGBABitmapImageReference
undefined reference to DrawScatterPlot
undefined reference to ConvertToPNG
After searching for a while I still cant figure out how to solve this.