Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
so i started copying some of the libusb library files from my ubuntu install.
That is usually not a good idea. Library packages (such as libusb) really need to be installed via their own make procedures to be sure that all files are installed in their proper places so that they all know where to find each other and so that other library packages (such as Device::USB) can know where to find all of them.
I did also use macports, so I have now cleared out all installed libusb files to remove any related issues.
What did you use from MacPorts? The libusb port or the libusb-legacy port?
Device::USB seems to require the usb.h header from libusb legacy(0.1)
Fair enough.... so you need the "legacy" version on Snow Leopard.
I have not installed g++ or any other compilers on my macbook.
Apple's Developer Tools are installed by default on Snow Leopard; so you should have all the compilers you (usually) need for this kind of task. One way to see this is at the 11th line of your output where you see:
checking for gcc... gcc
Otherwise, it should have died at that point.

Update: I stand corrected about Developer Tools on Snow Leopard (thanks dHarry). Nevertheless, it looks like you have some version Developer Tools installed, as some version of gcc is being detected (perhaps from a previous version of Mac OS X?). Make sure you have the latest Developer Tools to ensure compatibility.

Trying to compile libusb 0.1 results in the make error that i put in my original post.(see top of thread).
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.
May I suggest that you use MacPorts to install the libusb-legacy port? If I understand you correctly, you are trying to build it by hand. If you let MacPorts do the heavy lifting, it will (or should) ensure that you have all necessary prerequisites installed and (most important) that the compilations are done with the proper flags to avoid all those warnings about incompatible pointers and such.

To summarize:

  • Use MacPorts to install libusb-legacy
  • Set the environment variables to build Device::USB to point at the MacPorts install (I think these will be correct for MacPorts):
    • LIBUSB_LIBDIR=/opt/local/lib
    • LIBUSB_INCDIR=/opt/local/include
Good Luck!

Disclaimers: I'm not using MacPorts and I'm not running Snow Leopard. YMMV, but HTH.

In reply to Re^5: Problem make'ing Device::USB on osx Snow Leopard 10.6.2 by broomduster
in thread Problem make'ing Device::USB on osx Snow Leopard 10.6.2 by

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (9)
    As of 2018-06-20 21:57 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (117 votes). Check out past polls.