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

My module, Win32::SystemInfo, uses a DLL to determine processor speed on Windows9x systems. This is not an autoloaded DLL, the module simply makes a few Win32::API calls to get the correct values.

I recently received an email from someone who's using the module in a Windows 98 environment. The script that he has written runs fine normally, but when it's compiled into an executable using Perl2exe, the processor speed is not reported.

This is obviously a problem of the compiled script not being able to see the DLL, since Perl2exe only includes autoloaded DLLs. The problem I'm having is in getting Perl2exe to compile the DLL into the executable so that it works correctly.
I tried this first: perl2exe script.pl d:\perl\site\lib\win32\cpuspd.dll. The resulting executable was larger by the size of the DLL, but the module still couldn't locate it. The only way that I have been able to get the executable to work correctly is to comile the script into an executable, then create a directory structure called PERL2EXE_STORAGE/Win32 in the same directory where the executable is and place the DLL down in the directory. This is an ugly solution.

Is there any way I can force Perl2exe to include a DLL and give it a specific path? Is this something I should be taking up with the Perl2exe developers since it appears to be a missing feature?

Guildenstern
Negaterd character class uber alles!

Replies are listed 'Best First'.
Re: Perl2exe and non-autoloaded DLLs?
by the_slycer (Chaplain) on Feb 06, 2001 at 03:25 UTC
    One possibility might be to make sure that use Win32::Api is included in the script somewhere. If your module is making calls to that module then you probably need both in order for it to work, right?

    Otherwise, try adding a line like #perl2exe_include somemodule.pm at the start of the script.

    Also, try perl2exe with the -tiny option and make sure that the dlls are being created (look for yourmodname.dll), or when running the compiled script check c:\temp for the dlls.

    If we could get the actual error message and maybe a log of what p2exe is doing when you compile it that may be helpful.