My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
StrawberryPerlInstallation  
Instructions for getting Device::USB on Strawberry Perl.
Phase-Deploy, Featured
Updated Jan 18, 2010 by wjohn...@anomaly.org

Introduction

Although the Device::USB project was orignally developed on Linux, this has not stopped Windows developers from wanting to access their USB devices. Strawberry Perl actually makes this fairly easy.

Pre-Requisites

Before installing Device::USB, you will need a few other things first.

  1. Install Strawberry Perl
  2. Install the libusb-win32 library
  3. Install the Inline::C Perl module

If you are on this page, you have probably already accomplished step 1. The second step provides the library needed to talk to USB hardware of all types. Device::USB provides a Perl wrapper for this library.

Step three is needed in order to do an installation with an Inline::C module.

Installation

Once you have the pre-requisites taken care of, the installation is really straight-forward.

Since Windows does not really have a standard directory structure for include files and libraries, we need to tell the Device::USB installation where to find these files for libusb-win32.

  1. For Strawberry Perl, installation is normally performed from a command line. So you need to open a command (or DOS) window.
  2. Create or change to a short directory without spaces in the name. Spaces in the directory name causes problems with the cpan program.
  3.     cd C:\TEMP
  4. The Device::USB installation code gets this information from two environment variables: LIBUSB_INCDIR and LIBUSB_LIBDIR. If you installed libusb-win32 in the default location, you can use the lines below:
  5.     set LIBUSB_INCDIR=\Program Files\LibUSB-Win32\include
        set LIBUSB_LIBDIR=\Program Files\LibUSB-Win32\lib\gcc
  6. Install Device::USB with cpan
  7.     cpan Device::USB

This should complete successfully and Device::USB will be available. An easy test is to use perldoc to verify that the POD has been installed.

    perldoc Device::USB

Sign in to add a comment
Powered by Google Project Hosting