Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Why don't Win32::MemMap or Tie::Win32MemMap work with perl2exe or PAR/pp?

by keszler (Priest)
on Aug 05, 2004 at 05:28 UTC ( #380190=perlquestion: print w/replies, xml ) Need Help??

keszler has asked for the wisdom of the Perl Monks concerning the following question:

OK - this probably isn't a frequently asked question, but maybe it'll save someone the frustration I just went through.

Line #60 of is:

my $MemMapDLL=$Config{installsitearch}."\\auto\\Win32\\MemMap\\memmap. +dll";

perl2exe and pp dutifully include the memmap.dll in the .exe they create. perl2exe with -tiny copies memmap.dll to the program's directory. The problem is, with the hardcoded path in it doesn't get used.

The compiled program will run just fine on any system with Perl and Win32::MemMap installed, but fail with the unhelpful error message 'Can't call method "Call" on an undefined value at Win32/ line 111.' on any other PC.

A solution for perl2exe with -tiny is to edit, replacing line 60 with:

my $MemMapDLL=".\\MemMap.dll";

to make the compiled program check it's own directory for the .dll. An alternate solution would be to use whatever temp directory perl2exe or pp use.

Also, the use Config; line in can be commented out: line 60 was the only reason for it.

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Why don't Win32::MemMap or Tie::Win32MemMap work with perl2exe or PAR/pp?
by mikeock (Hermit) on Nov 02, 2005 at 03:11 UTC

    With the new version of perl2exe(Ver8.70), it allows you to use an include option when compiling. The syntax is as follows: #perl2exe_include modulename.

    I don't know if this would resolve the above issue for sure. As far as I can tell it forces the module to be included into the program and I believe it changes the module load location to within the program than from an external directory.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://380190]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2021-04-19 10:09 GMT
Find Nodes?
    Voting Booth?

    No recent polls found