Subject: | Case sensitivity issue zlib.dll vs. Zlib.dll with perl 5.8.0 under win32 |
This is not really a bug but an annoyance that should be covered in the README:
I installed perl 5.8.0 from source under Win2k with MSVC (gotta have those threads!) Then tried to install Bundle::CPAN 1.58. Compress::Zlib 1.18 failed because zlib is not included in MSVC libraries. Downloaded zlib 1.1.4 source from gzip.org. Compiled with MSVC. That creates zlib.dll and zlib.lib. Copied zlib.lib to perl CORE directory and dll to perl bin directory (building zlib at the same time as Compress::Zlib as recommended in the README doesn't work from the CPAN::shell). CPAN still didn't find it ("Note (probably harmless): 1 No library found for '-lz'") because it only looks for libz.lib, not zlib.lib so I renamed zlib.lib to libz.lib. Now Compress::Zlib builds but the test fails: The entry points in zlib.dll are not found (see attached GIF) because Zlib.dll is found first. I proved that by deleting all zlib.dll from my disk and still got the same error message.
Fix: Build libz.dll instead of just renaming the library.
In the zlib Makefile.nt, add
libz.dll: $(OBJ1) $(OBJ2) libz.dnt
link $(dlllflags) -out:$@ -def:libz.dnt $(OBJ1) $(OBJ2) $(guilibsdll)
libz.lib: libz.dll
and copy zlib.dnt to libz.dnt, changing the first line to
LIBRARY libz.dll
Then nmake -f Makefile.nt libz.dll libz.lib
Copy libz.lib to the CORE directory and libz.dll to Perl's bin directory and everything is fine.
It would be nicer if Compress::Zlib built its DLL under a different name than Zlib.dll to avoid the name conflict with zlib.dll. Or maybe Zlib.dll could make sure it does not look for zlib.dll in the same directory where it lives. Yeah, I know, Microsoft crap, but we have to live with it...
See below for the failed test (also see the attached GIF for the error message.) perl -V is there too.
Thanks,
Ralf-Peter
---------------
Running make for P/PM/PMQS/Compress-Zlib-1.18.tar.gz
Is already unwrapped into directory \.cpan\build\Compress-Zlib-1.18
Has already been processed within this session
Running make test
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
C:\Perl\perl5.8.0\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t\01version.t t\02z
lib.t t\03examples.t t\04encoding.t t\05gzsetp.t
t\01version.....Can't load 'C:\.cpan\build\Compress-Zlib-1.18\blib\arch/auto/Compress/Zlib/Zlib.dll' for module Compress::Zlib: load
_file:The operating system cannot run %1 at C:/Perl/perl5.8.0/lib/DynaLoader.pm line 229.
at t\01version.t line 5
Compilation failed in require at t\01version.t line 5.
BEGIN failed--compilation aborted at t\01version.t line 5.
t\01version.....dubious
Test returned status 255 (wstat 65280, 0xff00)
t\02zlib........Can't load 'C:\.cpan\build\Compress-Zlib-1.18\blib\arch/auto/Compress/Zlib/Zlib.dll' for module Compress::Zlib: load
_file:The operating system cannot run %1 at C:/Perl/perl5.8.0/lib/DynaLoader.pm line 229.
at t\02zlib.t line 6
Compilation failed in require at t\02zlib.t line 6.
BEGIN failed--compilation aborted at t\02zlib.t line 6.
t\02zlib........dubious
Test returned status 255 (wstat 65280, 0xff00)
t\03examples....NOK 6Can't load 'C:\.cpan\build\Compress-Zlib-1.18\blib\arch/auto/Compress/Zlib/Zlib.dll' for module Compress::Zlib:
load_file:The operating system cannot run %1 at C:/Perl/perl5.8.0/lib/DynaLoader.pm line 229.
at ./examples/filtdef line 6
Compilation failed in require at ./examples/filtdef line 6.
BEGIN failed--compilation aborted at ./examples/filtdef line 6.
t\03examples....FAILED tests 1-13
Failed 13/13 tests, 0.00% okay
t\04encoding....Can't load 'C:\.cpan\build\Compress-Zlib-1.18\blib\arch/auto/Compress/Zlib/Zlib.dll' for module Compress::Zlib: load
_file:The operating system cannot run %1 at C:/Perl/perl5.8.0/lib/DynaLoader.pm line 229.
at t\04encoding.t line 19
Compilation failed in require at t\04encoding.t line 19.
BEGIN failed--compilation aborted at t\04encoding.t line 19.
t\04encoding....dubious
Test returned status 255 (wstat 65280, 0xff00)
t\05gzsetp......Can't load 'C:\.cpan\build\Compress-Zlib-1.18\blib\arch/auto/Compress/Zlib/Zlib.dll' for module Compress::Zlib: load
_file:The operating system cannot run %1 at C:/Perl/perl5.8.0/lib/DynaLoader.pm line 229.
at t\05gzsetp.t line 6
Compilation failed in require at t\05gzsetp.t line 6.
BEGIN failed--compilation aborted at t\05gzsetp.t line 6.
t\05gzsetp......dubious
Test returned status 255 (wstat 65280, 0xff00)
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\01version.t 255 65280 ?? ?? % ??
t\02zlib.t 255 65280 ?? ?? % ??
t\03examples.t 13 13 100.00% 1-13
t\04encoding.t 255 65280 ?? ?? % ??
t\05gzsetp.t 255 65280 ?? ?? % ??
Failed 5/5 test scripts, 0.00% okay. 13/13 subtests failed, 0.00% okay.
NMAKE : fatal error U1077: 'C:\Perl\perl5.8.0\bin\perl.exe' : return code '0x2'
Stop.
C:\util\nmake.EXE test -- NOT OK
---------------
perl -V:
Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"c:\perl\perl5.8.0\lib\CORE" -machine:x86'
libpth="C:\Program Files\Microsoft Visual Studio\VC98\bin\lib"
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
gnulibc_version='undef'
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -libpath:"c:\perl\perl5.8.0\lib\CORE" -machine:x86'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
Built under MSWin32
Compiled at Oct 22 2002 09:02:35
@INC:
c:/Perl/perl5.8.0/lib
c:/Perl/perl5.8.0/site/lib
.