I am trying to run a code for FT245RL chip in kubuntu version 18.04. Which requires lftdi library. But it shows the error as undefined reference to ftdi_init
I have tried removing and installing the libraries again. I also tried to give the path in the command to execute. I even tried many improvized commands across the internet but was unable to succeed.
if (ftdi_init(&ftdic) < 0)
{
fprintf(stderr, "ftdi_init failed\n");
return EXIT_FAILURE;
}
f = ftdi_usb_open(&ftdic, 0x0403, 0x6001);
if (f < 0 && f != -5)
{
fprintf(stderr, "unable to open ftdi device: %d (%s)\n", f, ftdi_get_error_string(&ftdic));
exit(-1);
}
The expected result is just to compile the program without any errors.