On Tue, Sep 4, 2012 at 10:33 AM, Matteo Gasparin <email.diversa at gmail.com> wrote: > I'm trying to write a multi platform scanning utility using SANE but, while > everything with linux is fine, opening the device and all, I find issues > with windows, both xp 32 and 7 64 bit. I downloaded the source and compiled > it using cygwin and the libusb-win32 library and everything went fine; some > of the backends didn't build: > > *** canon_pp backend requires libieee1284 library - disabling > *** gphoto2 backend requires gphoto2 and JPEG libraries - disabling > *** hpsj5s backend requires libieee1284 library - disabling > *** mustek_pp backend requires libieee1284 and paraport-directio libraries - > disabling > *** mustek_usb2 backend requires pthread library - disabling > *** pint backend requires sys/scanio.h - disabling > *** qcam backend requires ioperm and portaccess functions - disabling > *** v4l backend requires v4l libraries - disabling > *** pnm backend not manually selected - disabling > > which is ok for me, since the scanner I'm trying to reach is a HP Scanjet > 5300C, which should use the avisio backend. I thought it could be a USB > driver issue so I used libwdi's zadig program to switch the normal xp driver > with the libusb-win32 one. After that sane-find-scanner could correctly > recognize the scanner but no luck using scanimage. > > Did I do something wrong? Did I miss something?
Hopefully, others with mingw32 experience will jump in as well. But to start, what version of sane-backends are you testing with? I occasionally test cross compiling sane-backends on Fedora using ming32 cross compiler and then I test the executable using wine with a networked Epson scanner. I compile with "configure BACKENDS=epson2" so I don't get much visibility into other backends. I have no experience testing USB support under mingw32 though. I believe avision is the only other backend that has much mingw32 testing by other users. I thought there has been successful USB access using libusb-win32 though. Your probably going to have to start debugging to get much further. You can try the SANE_DEBUG_SANEI_USB and SANEI_DEBUG_AVISION environment variables and see if you can spot were things are going wrong between Linux and Windows. > On top of that I'm using Java and JNA to interface with SANE; again > everything using linux is fine, while with windows it correctly loads the > library and then hangs at the first call of sane_init(null, null) . Someone > got an idea about that? Hmm, not sure. I recall having some odd issues with finding config files on windows. I think you may have to change into scanimage install directory before running your app or set the SANE_CONFIG_DIR environment variable. That type of failures shouldn't cause hang ups but you never know. Chris