Sunday, August 29, 2010

MinGW Win32 installation to build libusb-1.0 Windows Backend

libusb-1.0 Windows backend currently supports Cygwin, MinGW and MinGW-w64, MSVC and WDK as the building tool. Cygwin, MSVC and WDK are more straightforward to install under Windows. But MinGW and MinGW-w64 are less straightforward.

One way to solve this issue is to use cross-compile under Linux. Leading Linux distros have MinGW and even MinGW-w64 packages. And the auto-tools (automake, autoconf, libtool) are normally installed under Linux. For MinGW-w64 build, one think to take note is that you probably need to update the libtool to 2.2.8 and later. Ubuntu 10.04 still ships an older version of libtool which does not recognize 64bit library properly.

Native build with MinGW/MSys from is really not that difficult once you have the base system and auto-tools installed. Pete Batard has a blog entry talking about the setup.

I just checked again and now it seems MinGW people has recognized the problem and come up with a new automatic installer for the MinGW/Msys base system installation. The name is mingw-get. It is currently in alpha but rather usable. I just used it to set up a new MinGW/MSys base system under Windows 7 32bit.

mingw-get can be downloaded from MinGW Sourceforge site.

Once you have the base system, you need to install auto-tools for MinGW (not the MSys version). The auto-tools may need some MSys dependency packages as well (eg: perl, crypt, etc). After that, it is quite simple to build libusb-1.0 Windows backend.

As for MinGW-w64 64bit build, it is similar. You can download the 32bit MSys base system and MinGW-w64 64bit Windows binary snapshots from its Sourceforge website.

Alternatively, you can get 64bit binary from the following website (only for 64bit Windows).

After that, you still need to get 32bit auto-tools installed. I recommend you to use the ones from and not the ones from MinGW-w64 sites as I have encountered problems with them.

If you are more adventurous, you can try the multilib option to build 32bit and 64bit using the same toolchain. Pete has a blog entry for this. I have not tried this and will probably not try this myself.

There is an existing package WPG System64 which include multilib based MinGW-w64 and all the tools (and more) to build libusb-1.0 Windows backend. However, we found out that the MinGW-w64 compiler included is a bit outdated that the output is not compatible with the current MinGW-w64 compile. So it is not recommended any more.

Friday, August 6, 2010

libftdi-0.18 and libftdi-1.0 Win32 and Win64 binaries download

I have uploaded some Windows (32bit and 64bit) binary of libftdi and libftdi-1.0 to my Google Code picusb page. Most of them are cross-built under Linux with MinGW and MinGW-w64. So if you have some difficulties getting libftdi or libftdi-1.0 to be built under Windows, you may want to try out the binaries I built.

Windows 7 32bit installed

Last week I installed Windows 7 32bit Ultimate on my two-year old Acer M1641 desktop, it was a smooth process. The only unrecognized device of the original PC after the Win7 installation was a mysterious "co-processor" device. After installation of the Nvidia NForce chipset driver everything on the original PC was recognized. The added old Compro X50 PCI TV/FM card was also not recognized. Luckily Compro provides the driver and necessary applications for this 5-year old product.

There was a glitch, after the installation, the grub bootloader is gone, only Vista and Win7 are shown in the Windows bootloader. So I have to recover the grub bootloader so that I can boot into various Linux versions (Ubuntu 9.10 32bit, Ubuntu 10.04 64bit and Arch Linux).

I am now using Windows 7 Home Premium 64bit for my Asus laptop. Same as the experiences there, I do not see too much differences between Vista and Win 7. Being a new installation with less "junks", it seems to be a bit faster.

Other than that, one of the major difference is the XP mode. The nice thing about XP mode is that now it supports USB. This is not a fast PC to run the virtual XP mode since it lacks the Hardware Assisted Virtualization Technology feature and the amount of RAM is not that big. Still allocating 512MB to the XP mode seems to let the virtual XP run relatively smooth. But this is just a test and I do not really need XP or miss XP.

Overall, the first impression of Win 7 is positive. But heh my first impression with Vista was also not bad even though many people have negative views on Vista.