Subject: | standalone binary problem with dll load order on windows |
Scenario:
1. Create a standalone executable on machine A (from any .pl file):
- Windows XP por SP1 (IMHO, doesn't matter)
- Active Perl 5.8.0 Build 806 installed on a local drive whose location is C:\Perl
2. Transfer this executable on another machine B:
- Windows NT4 SP3
- Perl is installed on machine B: ActivePerl 5.6.1 Build 631, on a local drive whose location is C:\Perl
- %PATH% contains C:\Perl\bin (not sure whether it does matter)
3. Run the executable on machine B:
- Crash in par.exe (? that's the message displayed on the pop-up window displaying the access violation)
- A debugger will show that the executable has loaded those 2 dlls:
C:\Perl\lib\auto\IO.dll
C:\Perl\lib\bin\Perl56.dll
For some reason, the standalone executable loads its dlls firstly in C:\Perl, before looking to its own zipped dlls. As both Perl versions are different on machines A and B, it creates the crash.
IMHO, that is potentially a typical problem on windows machines since Perl is commonly ActiveState's one and is commonly installed in C:\Perl, whatever be its version.
-- Patrice Parmentier.
Notes:
n1. If C:\Perl is renamed C:\Perlxxx on machine B before running the standalone executable, then the standalone executable will work properly.
n2. If PATH is set to "." (but C:\Perl is not renamed) before running the standalone executable, then an error pop-up message is displayed: cannot find dynamic library perl56.dll in PATH=... then follows a PATH that begins with C:\Perl\bin and seems related to machine A...