On Sat, Sep 11, 2010 at 3:34 PM, Xiaofan Chen <xiaof...@gmail.com> wrote: > On Sat, Sep 11, 2010 at 2:44 PM, Ozkan Sezer <seze...@gmail.com> wrote: >> Try adding the attached inlines to your wdm.h (I think around line 242 just >> before the #endif /* defined(__GNUC__) */ ) and remove the -lmingwex >> from your makefile. These are the Interlocked* inlines from winnt.h made >> into static inlines. let's see if that makes a difference. >> > > It will still producing the following linking errors. Take note the > underscore. > > windres -I./src ./src/driver/libusb_driver_rc.rc -o libusb_driver_rc.o > gcc -static -o libusb0.sys abort_endpoint.o claim_interface.o clear_feature.o > di > spatch.o get_configuration.o get_descriptor.o get_interface.o get_status.o > ioctl > .o libusb_driver.o pnp.o release_interface.o reset_device.o reset_endpoint.o > set > _configuration.o set_descriptor.o set_feature.o set_interface.o transfer.o > vendo > r_request.o power.o driver_registry.o error.o libusb_driver_rc.o > libusb0_drv.de > f -s -shared -Wl,--entry,DriverEntry -nostartfiles -nostdlib -L. -lusbd > -lntoskr > nl -lhal > libusb_driver.o:libusb_driver.c:(.text+0x6a9): undefined reference to > `_Interloc > kedIncrement' > libusb_driver.o:libusb_driver.c:(.text+0x6d4): undefined reference to > `_Interloc > kedDecrement' > libusb_driver.o:libusb_driver.c:(.text+0x70d): undefined reference to > `_Interloc > kedDecrement' > transfer.o:transfer.c:(.text+0x149): undefined reference to > `_InterlockedIncreme > nt' > transfer.o:transfer.c:(.text+0x19a): undefined reference to > `_InterlockedDecreme > nt' > transfer.o:transfer.c:(.text+0x1cd): undefined reference to > `_InterlockedDecreme > nt' > transfer.o:transfer.c:(.text+0x324): undefined reference to > `_InterlockedDecreme > nt' > transfer.o:transfer.c:(.text+0x457): undefined reference to > `_InterlockedExchang > ePointer' > transfer.o:transfer.c:(.text+0x4ed): undefined reference to > `_InterlockedExchang > ePointer' > transfer.o:transfer.c:(.text+0x66d): undefined reference to > `_InterlockedIncreme > nt' > transfer.o:transfer.c:(.text+0xe3f): undefined reference to > `_InterlockedExchang > ePointer' > transfer.o:transfer.c:(.text+0xf76): undefined reference to > `_InterlockedIncreme > nt' > collect2: ld returned 1 exit status > make: *** [libusb0.sys] Error 1 >
Adding the following lines below your changes to wdm.h seems to fix the issue. #define _InterlockedIncrement InterlockedIncrement #define _InterlockedDecrement InterlockedDecrement #define _InterlockedExchangePointer InterlockedExchangePointer -- Xiaofan ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public