5
rated 0 times
[
5]
[
0]
/ answers: 1 / hits: 7091
/ 1 Year ago, tue, december 6, 2022, 6:31:11
I am trying to compile a program that uses libusb
library in Ubuntu 12.04.
I have installed the libusb-1.0-0-dev
. However, when I try to compile a program as below:
#include<usb.h>
#include<stdio.h>
#include<libusb-1.0/libusb.h>
int main()
{
libusb_init(NULL);
return 0;
}
It gives me an error saying
/tmp/ccb75YtE.o: In function 'main':
usb.c:(.text+0x11): undefined reference to 'libusb_init'
collect2: ld returned 1 exit status
I am using the command cc <file name> -lusb
to compile it.
What could be the problem?
More From » compiling