Steve_BZ has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

I seem to have a similar problem to Bruce32903 in trouble installing Device::USB. I have a clean install (ie a clean development environment with my dependencies already installed). OS is Kubuntu 10.04.1 Lucid. However, it's not going away. I started by running:

>sudo -s [sudo] password root@desktop:~# cpan -i Device::USB

Which gave me an error message. Sorry, the exact error message is lost after some instability. Anyhow it needed Inline::MakeMaker, which it got with no errors. Then I reran cpan -i Device::USB and got:

root@desktop:~# cpan -i Device::USB CPAN: Storable loaded ok (v2.20) + + Going to read '/home/image/.cpan/Metadata' + + Database was generated on Wed, 04 May 2011 17:29:02 GMT + + Running install for module 'Device::USB' CPAN: YAML loaded ok (v0.72) Running make for G/GW/GWADEJ/Device-USB-0.35.tar.gz CPAN: Digest::SHA loaded ok (v5.47) CPAN: Compress::Zlib loaded ok (v2.02) Checksum for /home/image/.cpan/sources/authors/id/G/GW/GWADEJ/Device-U +SB-0.35.tar.gz ok CPAN: Archive::Tar loaded ok (v1.52) Device-USB-0.35/ Device-USB-0.35/Changes Device-USB-0.35/dump_usb.pl Device-USB-0.35/Makefile.PL Device-USB-0.35/MANIFEST.SKIP Device-USB-0.35/MANIFEST Device-USB-0.35/README Device-USB-0.35/USB.pm Device-USB-0.35/t/ Device-USB-0.35/t/17-usb_dev_endpoint.t Device-USB-0.35/t/00-load.t Device-USB-0.35/t/07-list_devices_if.t Device-USB-0.35/t/05-find_device_if.t Device-USB-0.35/t/02-find_busses_devices.t Device-USB-0.35/t/15-usb_dev_configuration.t Device-USB-0.35/t/06-list_devices.t Device-USB-0.35/t/09-usb-bus.t Device-USB-0.35/t/16-usb_dev_interface.t Device-USB-0.35/t/14-bus_list_devices_if.t Device-USB-0.35/t/11-usb-device-methods.t Device-USB-0.35/t/boilerplate.t Device-USB-0.35/t/04-find_device.t Device-USB-0.35/t/pod-coverage.t Device-USB-0.35/t/03-list_busses.t Device-USB-0.35/t/08-get_busses.t Device-USB-0.35/t/10-usb-device-accessors.t Device-USB-0.35/t/13-bus_find_device_if.t Device-USB-0.35/t/pod.t Device-USB-0.35/t/TestTools.pm Device-USB-0.35/t/12-constants.t Device-USB-0.35/t/18-usb_device-configurations.t Device-USB-0.35/t/01-create-usb.t Device-USB-0.35/META.yml Device-USB-0.35/lib/ Device-USB-0.35/lib/Device/ Device-USB-0.35/lib/Device/USB/ Device-USB-0.35/lib/Device/USB/DevConfig.pm Device-USB-0.35/lib/Device/USB/FAQ.pod Device-USB-0.35/lib/Device/USB/Device.pm Device-USB-0.35/lib/Device/USB/DevInterface.pm Device-USB-0.35/lib/Device/USB/DevEndpoint.pm Device-USB-0.35/lib/Device/USB/Bus.pm Device-USB-0.35/lib/Device/USB.pm CPAN: File::Temp loaded ok (v0.22) CPAN.pm: Going to build G/GW/GWADEJ/Device-USB-0.35.tar.gz ERROR: Can't find usb.h header. If the library is not installed, you will need to install it. If it is installed somewhere other than /usr or /usr/local, you need to set the following environment variables: LIBUSB_LIBDIR should contain the path to the libusb libraries LIBUSB_INCDIR should contain the path to the libusb include files Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=s +ite] GWADEJ/Device-USB-0.35.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install

So I looked at libusb-0.1.4 with KPackagekit and it appeared on the installed AND available list. Anyhow it installed it, no problems, but still appeared on both lists. I reran the install but with the same error message.

Anyhow, your usual wisdom and common sense much appreciated.

Regards

Steve

Replies are listed 'Best First'.
Re: Device::USB installation problems (again)
by cjb (Friar) on May 05, 2011 at 07:49 UTC

      Hi cjb,

      Perfect, installed like a dream - at least on the clean environment. My sturdy old development machine wasn't so lucky. Maybe it's time for a rebuild, I'll have another go and see if I can get it going.

      Thanks for this.

      Regards

      Steve.

      Hi Guys,

      I'm still holding out on the rebuild. What follows is the latest installation log ("returned status 512" seems a little obscure, not to say binary).

      Thanks

      Steve

        I'm still holding out on the rebuild. What follows is the latest installation log ("returned status 512" seems a little obscure, not to say binary).

        look friend, look, clean out the junk, and look, cpan -fi module is a middleman, you need to look :) Has already been unwrapped into ... is code for junk, so you need make realclean, or do a fresh unwrap, and look :)

        From native exit codes 512 and 2304

        local $! = 512 >> 8; print "$!\n"; __END__ No such file or directory
        FYI, look is a cpan command, so you look, then you manually run perl Makefile.PL ...
Re: Device::USB installation problems (again)
by Khen1950fx (Canon) on May 05, 2011 at 15:19 UTC
    You're using an old version of the libusb API. There are two API's: libusb-0.1 and libusb-1.0. The 0.1 API, like the one that you are using, stopped development in 2007, so it's four years old. The maintainer of libusb recommends that developers use the newer API, 1.0. I use 1.0, and Device::USB installs without problems. You can get more info here.
Re: Device::USB installation problems (again)
by Anonymous Monk on May 05, 2011 at 01:22 UTC
    Anyhow, your usual wisdom and common sense much appreciated.

    Um, you need to set the following environment variables:
    LIBUSB_LIBDIR should contain the path to the libusb libraries
    LIBUSB_INCDIR should contain the path to the libusb include files
Re: Device::USB installation problems (again)
by Steve_BZ (Chaplain) on May 22, 2011 at 02:20 UTC

    Well, a rebuild sorted everything out. I don't know what caused the issue in the first place, but after installing

    sudo -s apt-get install libusb cpan -i Inline::MakeMaker cpan -i Device::USB

    Everything went smoothly. Plus the rebuild gave me a chance to refine the rebuild script (gradually moving to shell script), fix a couple of problems I didn't know I had and even gave me a performance improvement.

    Regards

    Steve