[Nut-upsdev] usb doesn't build on mac os x (10.4)

Ima Sudonim Ima.Sudonim at comcast.net
Tue Oct 18 21:13:01 UTC 2005


I am having problems building usb on mac os x. First, mac os x  
doesn't seem to have asm/types.h, just sys/types.h. I can't find  
hiddev.h on mac os x either. Also, it doesn't have usb.h but instead  
IOKIT/usb/USB.h. I am using mac os x (10.4), and the latest cvs of nut.

Is the new usb support going to work on mac os x? Is anyone working  
on it? It seems that libusb is available on mac os x via Fink,  
although Fink is not installed during os install, but must be added  
by the user.  I have not installed libusb on my system.

Can anyone please make any suggestions as to where to go from here? 8-)

#ifndef __APPLE__
#include <linux/hiddev.h>
#include <asm/types.h>
#include <usb.h>
#else
#include <IOKit/usb/USB.h>
#endif

Thanks!

Ima

------------------------

[Four-Computer:/src/nut] ima% make usb
gcc -I../include -O -Wall -Wsign-compare -c hidups.c
In file included from hidups.c:22:
hidups.h:39:10: error: #include expects "FILENAME" or <FILENAME>
hidups.c: In function 'find_application':
hidups.c:97: error: 'HIDIOCAPPLICATION' undeclared (first use in this  
function)
hidups.c:97: error: (Each undeclared identifier is reported only once
hidups.c:97: error: for each function it appears in.)
hidups.c: At top level:
hidups.c:104: warning: 'struct hiddev_event' declared inside  
parameter list
hidups.c:104: warning: its scope is only this definition or  
declaration, which is probably not what you want
hidups.c: In function 'parse_event':
hidups.c:110: error: dereferencing pointer to incomplete type
hidups.c:112: error: dereferencing pointer to incomplete type
hidups.c:112: error: dereferencing pointer to incomplete type
hidups.c:117: error: dereferencing pointer to incomplete type
hidups.c:119: error: dereferencing pointer to incomplete type
hidups.c:119: error: dereferencing pointer to incomplete type
hidups.c:123: error: dereferencing pointer to incomplete type
hidups.c:123: error: dereferencing pointer to incomplete type
hidups.c:124: error: dereferencing pointer to incomplete type
hidups.c:127: error: dereferencing pointer to incomplete type
hidups.c:130: error: dereferencing pointer to incomplete type
hidups.c:133: error: dereferencing pointer to incomplete type
hidups.c:136: error: dereferencing pointer to incomplete type
hidups.c:141: error: dereferencing pointer to incomplete type
hidups.c:141: error: dereferencing pointer to incomplete type
hidups.c:142: error: dereferencing pointer to incomplete type
hidups.c:148: error: dereferencing pointer to incomplete type
hidups.c:152: error: dereferencing pointer to incomplete type
hidups.c:152: error: dereferencing pointer to incomplete type
hidups.c:153: error: dereferencing pointer to incomplete type
hidups.c:159: error: dereferencing pointer to incomplete type
hidups.c:163: error: dereferencing pointer to incomplete type
hidups.c:163: error: dereferencing pointer to incomplete type
hidups.c:164: error: dereferencing pointer to incomplete type
hidups.c:170: error: dereferencing pointer to incomplete type
hidups.c:180: error: dereferencing pointer to incomplete type
hidups.c:180: error: dereferencing pointer to incomplete type
hidups.c: In function 'getvalue':
hidups.c:204: error: storage size of 'uref' isn't known
hidups.c:209: error: 'HID_REPORT_TYPE_FEATURE' undeclared (first use  
in this function)
hidups.c:210: error: 'HID_REPORT_ID_UNKNOWN' undeclared (first use in  
this function)
hidups.c:216: error: 'HIDIOCGUSAGE' undeclared (first use in this  
function)
hidups.c:204: warning: unused variable 'uref'
hidups.c:220: warning: control reaches end of non-void function
hidups.c: In function 'getstring':
hidups.c:224: error: storage size of 'uref' isn't known
hidups.c:225: error: storage size of 'sdesc' isn't known
hidups.c:232: error: 'HID_REPORT_TYPE_FEATURE' undeclared (first use  
in this function)
hidups.c:233: error: 'HID_REPORT_ID_UNKNOWN' undeclared (first use in  
this function)
hidups.c:237: error: 'HIDIOCGUSAGE' undeclared (first use in this  
function)
hidups.c:239: error: 'HIDIOCGSTRING' undeclared (first use in this  
function)
hidups.c:225: warning: unused variable 'sdesc'
hidups.c:224: warning: unused variable 'uref'
hidups.c: In function 'upsdrv_updateinfo':
hidups.c:286: error: array type has incomplete element type
hidups.c:290: error: 'HIDIOCINITREPORT' undeclared (first use in this  
function)
hidups.c:286: warning: unused variable 'ev'
hidups.c: In function 'setvalue':
hidups.c:348: error: storage size of 'uref' isn't known
hidups.c:349: error: storage size of 'rinfo' isn't known
hidups.c:353: error: 'HID_REPORT_TYPE_FEATURE' undeclared (first use  
in this function)
hidups.c:354: error: 'HID_REPORT_ID_UNKNOWN' undeclared (first use in  
this function)
hidups.c:360: error: 'HIDIOCGUSAGE' undeclared (first use in this  
function)
hidups.c:369: error: 'HIDIOCGREPORT' undeclared (first use in this  
function)
hidups.c:372: error: 'HID_REPORT_TYPE_OUTPUT' undeclared (first use  
in this function)
hidups.c:374: error: 'HIDIOCSUSAGE' undeclared (first use in this  
function)
hidups.c:379: error: 'HIDIOCSREPORT' undeclared (first use in this  
function)
hidups.c:349: warning: unused variable 'rinfo'
hidups.c:348: warning: unused variable 'uref'
hidups.c:403: warning: control reaches end of non-void function
hidups.c:543:2: warning: #warning "kernel doesn't return HIDDEV  
physical port paths"
hidups.c: In function 'upsdrv_initups':
hidups.c:558: warning: implicit declaration of function 'HIDIOCGNAME'
hidups.c:562: error: 'HIDIOCINITREPORT' undeclared (first use in this  
function)
make[1]: *** [hidups.o] Error 1
gcc -I../include -O -Wall -Wsign-compare  -o libhid.o -c libhid.c
In file included from libhid.c:39:
hid-usb.h:2:30: error: usb.h: No such file or directory
In file included from libhid.c:39:
hid-usb.h:7: error: parse error before '*' token
hid-usb.h:7: warning: type defaults to 'int' in declaration of 'udev'
hid-usb.h:7: warning: data definition has no type or storage class
libhid.c: In function 'HIDGetItemString':
libhid.c:258: warning: pointer targets in passing argument 2 of  
'libusb_get_string' differ in signedness
libhid.c:259: warning: pointer targets in return differ in signedness
libhid.c: In function 'HIDGetEvents':
libhid.c:368: warning: implicit declaration of function 'malloc'
libhid.c:368: warning: incompatible implicit declaration of built-in  
function 'malloc'
libhid.c: In function 'hid_lookup_usage':
libhid.c:715: warning: implicit declaration of function 'atoi'
make[1]: *** [libhid.o] Error 1
gcc -I../include -O -Wall -Wsign-compare -c energizerups.c
energizerups.c:24:23: error: asm/types.h: No such file or directory
energizerups.c:31:26: error: linux/hiddev.h: No such file or directory
energizerups.c: In function 'sendstring':
energizerups.c:114: error: storage size of 'rinfo' isn't known
energizerups.c:115: error: storage size of 'uref' isn't known
energizerups.c:127: error: 'HID_REPORT_TYPE_OUTPUT' undeclared (first  
use in this function)
energizerups.c:127: error: (Each undeclared identifier is reported  
only once
energizerups.c:127: error: for each function it appears in.)
energizerups.c:132: error: 'HIDIOCSUSAGE' undeclared (first use in  
this function)
energizerups.c:155: error: 'HIDIOCSREPORT' undeclared (first use in  
this function)
energizerups.c:115: warning: unused variable 'uref'
energizerups.c:114: warning: unused variable 'rinfo'
energizerups.c: In function 'hidcmd':
energizerups.c:209: error: array type has incomplete element type
energizerups.c:210: error: storage size of 'uref' isn't known
energizerups.c:222: error: 'HID_REPORT_TYPE_INPUT' undeclared (first  
use in this function)
energizerups.c:226: error: 'HIDIOCGUCODE' undeclared (first use in  
this function)
energizerups.c:227: error: 'HIDIOCGUSAGE' undeclared (first use in  
this function)
energizerups.c:232: warning: pointer targets in passing argument 2 of  
'sendstring' differ in signedness
energizerups.c:278: warning: pointer targets in passing argument 2 of  
'fake_hid_ev_bits' differ in signedness
energizerups.c:210: warning: unused variable 'uref'
energizerups.c:209: warning: unused variable 'ev'
energizerups.c: In function 'instcmd':
energizerups.c:286: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:293: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:307: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:307: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c:309: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:309: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c:316: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c: In function 'upsdrv_initinfo':
energizerups.c:341: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:341: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c:358: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c: In function 'upsdrv_updateinfo':
energizerups.c:380: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:380: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c: In function 'upsdrv_shutdown':
energizerups.c:444: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:444: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c:445: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
energizerups.c:445: warning: pointer targets in passing argument 2 of  
'hidcmd' differ in signedness
energizerups.c:460: warning: pointer targets in passing argument 1 of  
'hidcmd' differ in signedness
make[1]: *** [energizerups.o] Error 1



More information about the Nut-upsdev mailing list