Compiling modules in OSX, eg PyUSB?

Dr Mephesto dnhkng at googlemail.com
Fri Mar 20 17:36:03 CET 2009


windows? well, I thought that maybe the location of the "usb.h" thing
was relevant, and I didnt see it mentioned on the linux instructions.

find /usr -name usb.h -ls   gives me:
3545683       24 -rw-r--r--    1 root     wheel        8360 Mar 20
16:37 /usr/include/usb.h
3538549       24 -rw-rw-r--    1 root     wheel        8360 Feb 22
11:28 /usr/local/include/usb.h



sudo python setup.py install         this gives me:
pcfr147:pyusb-0.4.1 david$ sudo python setup.py install
Password:
running install
running build
running build_ext
building 'usb' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
fno-common -dynamic -DNDEBUG -g -O3 -I/Library/Frameworks/
Python.framework/Versions/4.1.30101/include/python2.5 -c pyusb.c -o
build/temp.macosx-10.3-i386-2.5/pyusb.o
In file included from pyusb.c:11:
pyusb.h:6:17: error: usb.h: No such file or directory
In file included from pyusb.c:11:
pyusb.h:120: error: syntax error before 'usb_dev_handle'
pyusb.h:120: warning: no semicolon at end of struct or union
pyusb.h:122: error: syntax error before '}' token
pyusb.h:122: warning: data definition has no type or storage class
pyusb.h:131: warning: 'struct usb_endpoint_descriptor' declared inside
parameter list
pyusb.h:131: warning: its scope is only this definition or
declaration, which is probably not what you want
pyusb.h:135: warning: 'struct usb_endpoint_descriptor' declared inside
parameter list
pyusb.h:140: warning: 'struct usb_interface_descriptor' declared
inside parameter list
pyusb.h:144: warning: 'struct usb_interface_descriptor' declared
inside parameter list
pyusb.h:149: warning: 'struct usb_config_descriptor' declared inside
parameter list
pyusb.h:153: warning: 'struct usb_config_descriptor' declared inside
parameter list
pyusb.h:171: warning: 'struct usb_bus' declared inside parameter list
pyusb.h:239: error: syntax error before '*' token
pyusb.h:241: warning: data definition has no type or storage class
pyusb.c: In function 'getBuffer':
pyusb.c:143: warning: passing argument 3 of 'PyString_AsStringAndSize'
from incompatible pointer type
pyusb.c: In function 'installModuleConstants':
pyusb.c:236: error: 'USB_CLASS_PER_INTERFACE' undeclared (first use in
this function)
pyusb.c:236: error: (Each undeclared identifier is reported only once
pyusb.c:236: error: for each function it appears in.)
pyusb.c:237: error: 'USB_CLASS_AUDIO' undeclared (first use in this
function)
pyusb.c:238: error: 'USB_CLASS_COMM' undeclared (first use in this
function)
pyusb.c:239: error: 'USB_CLASS_HID' undeclared (first use in this
function)
pyusb.c:240: error: 'USB_CLASS_PRINTER' undeclared (first use in this
function)
pyusb.c:241: error: 'USB_CLASS_MASS_STORAGE' undeclared (first use in
this function)
pyusb.c:242: error: 'USB_CLASS_HUB' undeclared (first use in this
function)
pyusb.c:243: error: 'USB_CLASS_DATA' undeclared (first use in this
function)
pyusb.c:244: error: 'USB_CLASS_VENDOR_SPEC' undeclared (first use in
this function)
pyusb.c:245: error: 'USB_DT_DEVICE' undeclared (first use in this
function)
pyusb.c:246: error: 'USB_DT_CONFIG' undeclared (first use in this
function)
pyusb.c:247: error: 'USB_DT_STRING' undeclared (first use in this
function)
pyusb.c:248: error: 'USB_DT_INTERFACE' undeclared (first use in this
function)
pyusb.c:249: error: 'USB_DT_ENDPOINT' undeclared (first use in this
function)
pyusb.c:250: error: 'USB_DT_HID' undeclared (first use in this
function)
pyusb.c:251: error: 'USB_DT_REPORT' undeclared (first use in this
function)
pyusb.c:252: error: 'USB_DT_PHYSICAL' undeclared (first use in this
function)
pyusb.c:253: error: 'USB_DT_HUB' undeclared (first use in this
function)
pyusb.c:254: error: 'USB_DT_DEVICE_SIZE' undeclared (first use in this
function)
pyusb.c:255: error: 'USB_DT_CONFIG_SIZE' undeclared (first use in this
function)
pyusb.c:256: error: 'USB_DT_INTERFACE_SIZE' undeclared (first use in
this function)
pyusb.c:257: error: 'USB_DT_ENDPOINT_SIZE' undeclared (first use in
this function)
pyusb.c:258: error: 'USB_DT_ENDPOINT_AUDIO_SIZE' undeclared (first use
in this function)
pyusb.c:259: error: 'USB_DT_HUB_NONVAR_SIZE' undeclared (first use in
this function)
pyusb.c:260: error: 'USB_MAXENDPOINTS' undeclared (first use in this
function)
pyusb.c:261: error: 'USB_ENDPOINT_ADDRESS_MASK' undeclared (first use
in this function)
pyusb.c:262: error: 'USB_ENDPOINT_DIR_MASK' undeclared (first use in
this function)
pyusb.c:263: error: 'USB_ENDPOINT_TYPE_MASK' undeclared (first use in
this function)
...
and lots lots more. do you want the whole lot? It still cant find that
usb.h file.

dave



More information about the Python-list mailing list