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

Is the use of libdwi the only way to see the usb devices from Windows? 
Seems kind of a complicated and hackish way to get it work...<br><br>Thanks for the advice about the working directory, I'll try to verify that<br><br>Also, sorry for the double post<br>