problem compiling testtool

  • Nobody/Anonymous


    when i compile testtool, when it links the differnets .o files it doesnt find the libusb functions

    niash_libusb.o(.text+0xe): In function `NiashLibUsbInit':
    /home/jose/backend/niash_libusb.c:52: undefined reference to `usb_init'
    niash_libusb.o(.text+0x13):/home/jose/backend/niash_libusb.c:53: undefined reference to `usb_find_busses'
    niash_libusb.o(.text+0x18):/home/jose/backend/niash_libusb.c:54: undefined reference to `usb_find_devices'
    niash_libusb.o(.text+0x1d):/home/jose/backend/niash_libusb.c:55: undefined reference to `usb_busses'
    niash_libusb.o(.text+0xe9): In function `NiashLibUsbOpen':
    /home/jose/backend/niash_libusb.c:89: undefined reference to `usb_find_busses'
    niash_libusb.o(.text+0xee):/home/jose/backend/niash_libusb.c:90: undefined reference to `usb_find_devices'
    niash_libusb.o(.text+0xf3):/home/jose/backend/niash_libusb.c:91: undefined reference to `usb_busses'
    niash_libusb.o(.text+0x164):/home/jose/backend/niash_libusb.c:102: undefined reference to `usb_open'
    niash_libusb.o(.text+0x17a):/home/jose/backend/niash_libusb.c:103: undefined reference to `usb_claim_interface'
    niash_libusb.o(.text+0x19e):/home/jose/backend/niash_libusb.c:106: undefined reference to `usb_close'
    niash_libusb.o(.text+0x240): In function `NiashLibUsbExit':
    /home/jose/backend/niash_libusb.c:135: undefined reference to `usb_release_interface'
    niash_libusb.o(.text+0x26b):/home/jose/backend/niash_libusb.c:140: undefined reference to `usb_close'
    niash_libusb.o(.text+0x2e3): In function `_LibUsbReadControl':
    /home/jose/backend/niash_libusb.c:159: undefined reference to `usb_control_msg'
    niash_libusb.o(.text+0x35b): In function `_LibUsbWriteControl':
    /home/jose/backend/niash_libusb.c:179: undefined reference to `usb_control_msg'
    niash_libusb.o(.text+0x452): In function `NiashLibUsbWriteBulk':
    /home/jose/backend/niash_libusb.c:214: undefined reference to `usb_bulk_write'
    niash_libusb.o(.text+0x509): In function `NiashLibUsbReadBulk':
    /home/jose/backend/niash_libusb.c:242: undefined reference to `usb_bulk_read'
    collect2: ld returned 1 exit status

    i tried manually : gcc -L/usr/lib  -lm  -lusb -o testtool  niash_core.o niash_libusb.o testtool_xfer.o main.o

    but same error , and when i do libusb-config --libs it returns /usr/lib/
    what do i have to do ??

    thanks for your answers


    • Ricardo Martins

      Ricardo Martins - 2005-02-18

      Please supply more information:
        - Distribution name and version;
        - LibUSB version;

      • Nobody/Anonymous

        I have the same problem and mi distribution its gentoo kernel 2.6.9 and libusb 0.1.8

    • Nobody/Anonymous

      ok i have a gentoo (kernel 2.6) and libusb-config --version give me 0.1.8

      (the anonymous guy who has post the first message ;)

    • Nobody/Anonymous

      i have got a gentoo with kernel 2.6 and libusb --version give me  0.1.8


    • Ullrich Sigwanz

      Ullrich Sigwanz - 2005-03-21


      Silly question...

      Why don't you try the whole sane backends, they work!.

      Before we try to fiddle around with this testtool, which was really helpfull in the alpha phase of this project,

      invoke as root 

      ./configure --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ && make\ && make install

      with the untarred sane-backeneds-1.0.15
      and uncomment


      in /etc/sane.d/dll.conf

      I guess the sane lib-usb interfacing can handle libusb better, hopefully

      The effort is not much bigger, but the outcome is for sure more valuable and useful




Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks