# Error: undefined reference to usb..., libusb instld [SOLVED]

## gregp01

I'm trying to compile the Fuji FinePix webcam driver available at http://www.bazon.net/mishoo/articles.epl?art_id=759, and I'm getting the following error:

```
fuji-finepixa310-test # make

gcc -g2 -O0 -Wall -lusb  stream.o   -o stream

stream.o(.text+0xb): In function `find_our_black_sheep':

/home/greg/download/fuji-finepixa310-test/stream.c:29: undefined reference to `usb_busses'

stream.o(.text+0x10e): In function `reset_pipes':

/home/greg/download/fuji-finepixa310-test/stream.c:82: undefined reference to `usb_resetep'

stream.o(.text+0x15b):/home/greg/download/fuji-finepixa310-test/stream.c:83: undefined reference to `usb_clear_halt'

stream.o(.text+0x21c): In function `init_device':

/home/greg/download/fuji-finepixa310-test/stream.c:96: undefined reference to `usb_bulk_write'

stream.o(.text+0x2c3):/home/greg/download/fuji-finepixa310-test/stream.c:102: undefined reference to `usb_control_msg'

stream.o(.text+0x341):/home/greg/download/fuji-finepixa310-test/stream.c:117: undefined reference to `usb_bulk_read'

stream.o(.text+0x3ca):/home/greg/download/fuji-finepixa310-test/stream.c:126: undefined reference to `usb_control_msg'

stream.o(.text+0x449):/home/greg/download/fuji-finepixa310-test/stream.c:139: undefined reference to `usb_bulk_write'

stream.o(.text+0x4d8):/home/greg/download/fuji-finepixa310-test/stream.c:145: undefined reference to `usb_control_msg'

stream.o(.text+0x578):/home/greg/download/fuji-finepixa310-test/stream.c:157: undefined reference to `usb_control_msg'

stream.o(.text+0x624):/home/greg/download/fuji-finepixa310-test/stream.c:169: undefined reference to `usb_control_msg'

stream.o(.text+0x6b0):/home/greg/download/fuji-finepixa310-test/stream.c:182: undefined reference to `usb_bulk_read'

stream.o(.text+0x87d): In function `get_frame':

/home/greg/download/fuji-finepixa310-test/stream.c:236: undefined reference to `usb_control_msg'

stream.o(.text+0x929):/home/greg/download/fuji-finepixa310-test/stream.c:242: undefined reference to `usb_bulk_read'

stream.o(.text+0x9c1): In function `main':

/home/greg/download/fuji-finepixa310-test/stream.c:263: undefined reference to `usb_init'

stream.o(.text+0x9c6):/home/greg/download/fuji-finepixa310-test/stream.c:264: undefined reference to `usb_find_busses'

stream.o(.text+0x9cb):/home/greg/download/fuji-finepixa310-test/stream.c:265: undefined reference to `usb_find_devices'

stream.o(.text+0xa12):/home/greg/download/fuji-finepixa310-test/stream.c:273: undefined reference to `usb_open'

stream.o(.text+0xa36):/home/greg/download/fuji-finepixa310-test/stream.c:275: undefined reference to `usb_claim_interface'

stream.o(.text+0xa93):/home/greg/download/fuji-finepixa310-test/stream.c:276: undefined reference to `usb_set_configuration'

stream.o(.text+0xaf7):/home/greg/download/fuji-finepixa310-test/stream.c:277: undefined reference to `usb_set_altinterface'

stream.o(.text+0xc2b):/home/greg/download/fuji-finepixa310-test/stream.c:289: undefined reference to `usb_clear_halt'

stream.o(.text+0xcc4):/home/greg/download/fuji-finepixa310-test/stream.c:294: undefined reference to `usb_get_string_simple'

stream.o(.text+0xe4a):/home/greg/download/fuji-finepixa310-test/stream.c:322: undefined reference to `usb_release_interface'

stream.o(.text+0xe56):/home/greg/download/fuji-finepixa310-test/stream.c:323: undefined reference to `usb_close'

collect2: ld returned 1 exit status

make: *** [stream] Error 1
```

I have libusb installed and can see the various libs in /usr/lib:

```
*  dev-libs/libusb

      Latest version available: 0.1.8

      Latest version installed: 0.1.8

      Size of downloaded files: 313 kB

      Homepage:    http://libusb.sourceforge.net/

      Description: Userspace access to USB devices

      License:     LGPL-2
```

```
# ls /usr/lib/libusb*

/usr/lib/libusb.la

/usr/lib/libusb

/usr/lib/libusb-0.1.4

/usr/lib/libusb-0.1.4.4.0

/usr/lib/libusb.a
```

How can I get this to compile?Last edited by gregp01 on Thu Jun 02, 2005 11:11 pm; edited 1 time in total

----------

## grunthus

Could be a kernel issue - have you got UHCI, OHCI, EHCI and any other appropriate settings made in you kernel? Might be worth posting the relevant part of the kernel .config here

----------

## gregp01

As far as I can tell, I have all the relevant USB support (OHCI, EHCI, core, etc.) compiled into my kernel. This is the USB section of my 2.6.11-gentoo-r7 AMD64 .config:

```
#

# USB support

#

CONFIG_USB=y

# CONFIG_USB_DEBUG is not set

#

# Miscellaneous USB options

#

CONFIG_USB_DEVICEFS=y

# CONFIG_USB_BANDWIDTH is not set

# CONFIG_USB_DYNAMIC_MINORS is not set

# CONFIG_USB_SUSPEND is not set

# CONFIG_USB_OTG is not set

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

#

# USB Host Controller Drivers

#

CONFIG_USB_EHCI_HCD=y

# CONFIG_USB_EHCI_SPLIT_ISO is not set

# CONFIG_USB_EHCI_ROOT_HUB_TT is not set

CONFIG_USB_OHCI_HCD=y

# CONFIG_USB_UHCI_HCD is not set

# CONFIG_USB_SL811_HCD is not set

#

# USB Device Class drivers

#

CONFIG_USB_AUDIO=y

# CONFIG_USB_BLUETOOTH_TTY is not set

# CONFIG_USB_MIDI is not set

# CONFIG_USB_ACM is not set

CONFIG_USB_PRINTER=y

#

# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information

#

CONFIG_USB_STORAGE=y

# CONFIG_USB_STORAGE_DEBUG is not set

# CONFIG_USB_STORAGE_RW_DETECT is not set

# CONFIG_USB_STORAGE_DATAFAB is not set

# CONFIG_USB_STORAGE_FREECOM is not set

# CONFIG_USB_STORAGE_ISD200 is not set

# CONFIG_USB_STORAGE_DPCM is not set

# CONFIG_USB_STORAGE_HP8200e is not set

# CONFIG_USB_STORAGE_SDDR09 is not set

# CONFIG_USB_STORAGE_SDDR55 is not set

# CONFIG_USB_STORAGE_JUMPSHOT is not set

#

# USB Input Devices

#

CONFIG_USB_HID=y

CONFIG_USB_HIDINPUT=y

# CONFIG_HID_FF is not set

# CONFIG_USB_HIDDEV is not set

# CONFIG_USB_AIPTEK is not set

# CONFIG_USB_WACOM is not set

# CONFIG_USB_KBTAB is not set

# CONFIG_USB_POWERMATE is not set

# CONFIG_USB_MTOUCH is not set

# CONFIG_USB_EGALAX is not set

# CONFIG_USB_XPAD is not set

# CONFIG_USB_ATI_REMOTE is not set

#

# USB Imaging devices

#

# CONFIG_USB_MDC800 is not set

# CONFIG_USB_MICROTEK is not set

#

# USB Multimedia devices

#

# CONFIG_USB_DABUSB is not set

# CONFIG_USB_VICAM is not set

# CONFIG_USB_DSBR is not set

# CONFIG_USB_IBMCAM is not set

# CONFIG_USB_KONICAWC is not set

# CONFIG_USB_OV511 is not set

# CONFIG_USB_SE401 is not set

CONFIG_USB_SN9C102=m

# CONFIG_USB_STV680 is not set

#

# USB Network Adapters

#

# CONFIG_USB_CATC is not set

# CONFIG_USB_KAWETH is not set

# CONFIG_USB_PEGASUS is not set

# CONFIG_USB_RTL8150 is not set

# CONFIG_USB_USBNET is not set

#

# USB port drivers

#

# CONFIG_USB_USS720 is not set

#

# USB Serial Converter support

#

# CONFIG_USB_SERIAL is not set

#

# USB Miscellaneous drivers

#

# CONFIG_USB_EMI62 is not set

# CONFIG_USB_EMI26 is not set

# CONFIG_USB_AUERSWALD is not set

# CONFIG_USB_RIO500 is not set

# CONFIG_USB_LEGOTOWER is not set

# CONFIG_USB_LCD is not set

# CONFIG_USB_LED is not set

# CONFIG_USB_CYTHERM is not set

# CONFIG_USB_PHIDGETKIT is not set

# CONFIG_USB_PHIDGETSERVO is not set

# CONFIG_USB_IDMOUSE is not set

# CONFIG_USB_TEST is not set

#

# USB ATM/DSL drivers

#

#

# USB Gadget Support

#

# CONFIG_USB_GADGET is not set
```

----------

## gregp01

It turns out this is the same problem as in this thread: it's a libusb bug that's fixed in the ~amd64 keyword ebuild.

----------

