PDK cross compile error : solaris

Posted by abdelaziz.jlibane@pb.com on 2011-08-17 08:48

On Windows, I use PDK 9.1 for generating a target application for solaris x86. by executing the application on the target machine (solaris x86) I have an error message "Can not locate Win32.pm in @INC"

Example code:

print "$ ^ O xxxxxx \ n";

  if ($ ^ O = ~ / MSWin32 / i) {
      use Win32;
      Win32-> import ();
      die "On Windows platform \ n";
else {
     require 'Fcntl.pm';
     Fcntl-> import (qw (: flock));
     die "On Unix platform \ n";

ActiveState Staff
Tue, 2011-08-23 16:03

The if statement needs to be in a BEGIN block, and Win32 should be called using a require instead of a use.