An undefined reference error occurs when calling libcyusb.so. The specific process is as follows:
test.c is as follows:
#include "cyusb.h"
int main(int argc, char ** argv)
{
cyusb_open();
return 0;
}
cyusb_open is a library function in libcyusb.so, use
g++ test.c -lcyusb compiles correctly
gcc test.c -lcyusb error, prompting cyusb_open() undefined reference
Try linking step by step:
g ++ test.c -o test.o
gcc test.o -lcyusb -o test compiles correctly