in reply to Problem make'ing Device::USB on osx Snow Leopard 10.6.2

That doesn't look like Device::USB
  • Comment on Re: Problem make'ing Device::USB on osx Snow Leopard 10.6.2

Replies are listed 'Best First'.
Re^2: Problem make'ing Device::USB on osx Snow Leopard 10.6.2
by nick.fox (Novice) on Jan 17, 2010 at 14:15 UTC

    You are indeed correct, i copied from the wrong terminal. the following is the correct make error from Device::USB. sorry about that.

    Also, Just to elaborate a little, when building Device::USB on ubuntu 9.10 it requires libusb v0.1.12 LEGACY. it seems that Device::USB requires the usb.h C header which is either not present in the latest version of libusb or has a different name.

    im starting to think my problems are more to do with this dependency than Device::USB itself.

      I think you are correct, because this:

      Note (probably harmless): No library found for -lusb

      indicates that libusb was not found at all.

      ...requires the usb.h C header which is either not present in the latest version of libusb or has a different name.
      Actually, it looks as if you have multiple versions of usb.h (hence, multiple installs of libusb) that are being detected. Look carefully through the output you posted and you see lots of things like this:
      USB.xs:16: error: conflicting types for ‘libusb_init’ /opt/local/include/libusb-1.0/usb.h:768: error: previous declaration o +f ‘libusb_init’ was here
      Now you just need to find the competing version, but I don't see anything in your posted output to help solve that problem.

      Update: I looked right past the point Corion mentions, so obviously I don't have the full story. You may need to tweak some settings in Makefile.PL to properly detect the one version of libusb that you want to use.

      Update 2: It looks like you are using MacPorts to supply libusb. Since MacPorts has multiple versions available, I'm betting that you have both the "stable" and the "legacy" versions installed, which is why usb.h is found more than once. I don't use MacPorts, so I can't offer any advice about what's the best way out of this, but I do think you need to tell Makefile.PL where to find what it's looking for.

        Ok that sounds plausible. I have previously tried to compile both libusb 0.1.12Legacy AND libusb 1.0.6(current stable). Unfortunately, libusb 0.1 does not want to compile. so i started copying some of the libusb library files from my ubuntu install. I did also use macports, so I have now cleared out all installed libusb files to remove any related issues.

        Device::USB seems to require the usb.h header from libusb legacy(0.1) as i compiled the latest libusb(1.0.6) on ubuntu but Device::USB would not compile, looking for the usb.h header. I then cleaned out the installed files and built libusb legacy v0.1.12. I then got a compiler error and had to install g++ from apt. It then compiled fine.

        I have not installed g++ or any other compilers on my macbook. Trying to compile libusb 0.1 results in the make error that i put in my original post.(see top of thread).

        Broomduster / Corion; The makefile does allow an environment var to be set with the location of the lib and include directories to use. I have tried setting this to /usr/local/ (libusb 1.0x) and /opt/local/ (macports) but still compile errors occur.

        Im now assuming there is some compiler related issue with building libusb 0.1.12 on snow leopard. unfortunately this is as far as my compiler knowledge extends. thanks for all this help by the way. ive been at this for days!

        libusb legacy v0.1.12 compile time error..