libusb 0.1 中testlibusb.c 编译注意

/tmp/ccxebRRF.o: In function `print_device':
testlibusb.c:(.text+0x370): undefined reference to `usb_open'
testlibusb.c:(.text+0x3c9): undefined reference to `usb_get_string_simple'
testlibusb.c:(.text+0x4a3): undefined reference to `usb_get_string_simple'
testlibusb.c:(.text+0x6b6): undefined reference to `usb_get_string_simple'
testlibusb.c:(.text+0x70a): undefined reference to `usb_close'
/tmp/ccxebRRF.o: In function `main':
testlibusb.c:(.text+0x865): undefined reference to `usb_init'
testlibusb.c:(.text+0x86a): undefined reference to `usb_find_busses'
testlibusb.c:(.text+0x86f): undefined reference to `usb_find_devices'
testlibusb.c:(.text+0x876): undefined reference to `usb_busses'

gcc testlibusb.c -o testlibusb -I/usr/include/ -Im -lusb

猜你喜欢

转载自blog.csdn.net/gd6321374/article/details/89500213