in reply to Win32::SerialPort - compilation failed in require

Hi,
IIRC, Win32::SerialPort needs Win32::API - and if you don't have Win32::API, you'll get the type of error that you described. (It's best to provide a copy'n'paste of the error message, rather than a synopsis of it - as the synopsis will often fail to include relevant pieces of information :-)

Cheers,
Rob
  • Comment on Re: Win32::SerialPort - compilation failed in require

Replies are listed 'Best First'.
Re^2: Win32::SerialPort - compilation failed in require
by crtjer (Initiate) on May 02, 2007 at 15:43 UTC
    I apologize I'm using Eclipse Perl Integration. I have Win32::API as well. I'm using Active Perl. If I run the command "perl sample.pl" I get this:
    "Can't locate loadable object for module Device::SerialPort in @INC (@ +INC contain s: C:/Program Files/ActivePerl/ActivePerl/perl/site/lib C:/Program Fil +es/ActiveP erl/ActivePerl/perl/lib .) at com.pl line 10 Compilation failed in require at com.pl line 10. BEGIN failed--compilation aborted at com.pl line 10."
      That message is telling you that, although Device/SerialPort.pm can be found, the "loadable object" (namely auto/Device/SerialPort/SerialPort.dll), which would be a critical piece of the Device::SerialPort package, cannot be found. You shouldn't need to use Device::SerialPort on Win32 - and if you do need it, then I think you're in trouble. Afaik it has never been built on Win32.

      Best thing to do is to remove all references to it from your code, and concentrate on getting things to work using just Win32::SerialPort.

      Cheers,
      Rob