From: Martin P. <vad...@gm...> - 2009-07-08 07:05:54
|
On 08/07/2009, Stephan Meyer <ste...@go...> wrote: > On Wed, Jul 8, 2009 at 2:00 AM, Xiaofan Chen<xia...@gm...> wrote: > > Just one question, the 64bit version is build from DDK/WDK so that > > it is only available for MSVC and not MinGW GCC, right? Is it > > possible for MinGW GCC based program to access the DLL > > under XP 64? > > > Yes, the 64bit version is compiled with MSVC but you can > use it with MinGW: > > * add /lib/dynamic/libusb_dyn.c to your project > * in line 25 replace "libusb0.dll" with "libusb0_x64.dll" > * compile > * the 64bit DLL will now be loaded dynamically at runtime > > This method should work with any compiler on any system. As for actually linking rather than dynamic loading, have you actually tried getting GCC to link to the MSVC library? I'm pretty sure I've done this in the past (to 32 bit .lib files and .dll files, not 64 bits though). Eg something like one of these gcc file1.o file2.o libusb.lib gcc file1.o file2.o libusb0_x64.dll Or even if the file name is of the right format in the right directory: gcc file1.o file2.o -llibusb (or -lusb0_x64 maybe?) I'm pretty sure GCC can understand the MSVC lib format (although not other formats like Borland). I found some of this stuff in the ld (linker) manual an interesting read: http://sourceware.org/binutils/docs-2.19/ld/WIN32.html Also: http://wyw.dcweb.cn/dllfaq.htm |