08-23-04 06:38 AM
Hi ,
I'm trying to write a program which reads a stream of data from a
USB Barcode-Reader - HID3 (in Solaris 8)
When I tried to compile the code I got some errors.....
Please if anyone could help me understand what's wrong ...
Many thanks.
#include <time.h>
#include <stdio.h> /* Standard input/output definitions */
#include <string.h> /* String function definitions */
#include <stdlib.h>
#include <unistd.h> /* UNIX standard function definitions */
#include <fcntl.h> /* File control definitions */
#include <errno.h> /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */
#include <sys/vuid_queue.h>
main( int argc, char *argv[]){
int fd,rval;
char c;
Firm_event fe;
fd = open("dev/usb/hid3",O_RDWR);
if (fd < 0 ) {
exit (1);
}
if ((rval = ioctl(fd, I_PUSH,"usbkbm")) < 0 ) {
exit (1);
}
while (read(fd, &fe, sizeof(fe))) {
printf("\n");
printf("%d", fe.id);
printf("%d", fe.value);
}
}
and I get for
gcc bcode.c -o bcode
In file included from bcode.c:9:
/usr/include/sys/vuid_queue.h:46: parse error before "Firm_event"
bcode.c: In function `main':
bcode.c:14: `Firm_event' undeclared (first use in this function)
bcode.c:14: (Each undeclared identifier is reported only once
bcode.c:14: for each function it appears in.)
bcode.c:14: parse error before "fe"
bcode.c:19: `I_PUSH' undeclared (first use in this function)
bcode.c:22: `fe' undeclared (first use in this function)
[ Post a follow-up to this message ]
|