[sane-devel] I'm getting there...

Jason Anderson sirius-c at iname.com
Sun Dec 21 03:06:42 GMT 2003


Hello once again, guys.

I'd like to thank you guys for taking your precious time to help me.  I, once again, need some assistance.

Here's the code from "hubba.c":
--------------
#include <unistd.h>
#include <stdlib.h>
#include "../include/sane/sane.h"
#include "../include/sane/config.h"
#include "../include/sane/sanei.h"
#include "../include/sane/sanei_usb.h"

/* Declare any prototypes */
SANE_Status status;

int main(void) {

SANE_Int fd;

/* Start up the usb_interface */
sanei_usb_init();

/* Try to access the usb device */
status = sanei_usb_open("/dev/usb/scanner0",fd);

/* Check the status */
if (status != SANE_STATUS_GOOD) {
  return -1;
    }

/* Try to close the USB device */
sanei_usb_close(fd);
}

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

And here's the error message I recieve:
--------------
 gcc hubba.c
hubba.c: In function `main':
hubba.c:27: warning: passing arg 1 of `sanei_usb_close' makes integer from pointer without a cast
/tmp/ccWqpZ3d.o(.text+0x11): In function `main':
: undefined reference to `sanei_usb_init'
/tmp/ccWqpZ3d.o(.text+0x21): In function `main':
: undefined reference to `sanei_usb_open'
/tmp/ccWqpZ3d.o(.text+0x46): In function `main':
: undefined reference to `sanei_usb_close'
collect2: ld returned 1 exit status
--------------

Some have suggested just to use "&fd" in both of the functions (sanei_usb_open and sanei_usb_close).  That is what I am going to use.  But I can't seem to link the file to another file such as "sanei_usb.lo".  I have given the full path to the file, but to no avail, such as in "gcc -l /path/to/object/file/ hubba.c".

Thank you again in advance.
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm





More information about the sane-devel mailing list