http://qs321.pair.com?node_id=181840


in reply to Compiling Tk::PNG on win32 (complications, more c/xs than perl)

Finally I succeeded building it, here is a proof-log :)
D:\WORK\PerlCompile\compile-modules\perl561\Tk-PNG-2.005>perl -w Makef +ile.PL d:/WORK/PerlCompile/compile-modules/perl561/Tk-PNG-2.005 does not star +t with D:/perl561/site/lib i.e. building outside Tk itself Finding dependancies for PNG.xs Finding dependancies for imgPNG.c Writing Makefile for Tk::PNG D:\WORK\PerlCompile\compile-modules\perl561\Tk-PNG-2.005>vc nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. "Running Mkbootstrap for Tk::PNG ()" D:\perl561\bin\perl.exe -Id:\perl561\lib -Id:\perl561\lib -MEx +tUtils::Command -e chmod 644 PNG.bs D:\perl561\bin\perl.exe "-Id:\perl561\lib" "-Id:\perl561\lib" +-MExtUtils::Mksymlists -e "Mksymlists('NAME' => 'Tk::PNG', 'DLBASE' +=> 'PNG', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'D +L_VARS' => []);" link -out:blib\arch\auto\Tk\PNG\PNG.dll -dll -nologo -nodefaul +tlib -release -libpath:"d:\perl561\lib\CORE" -machine:x86 PNG.obj +imgPNG.obj D:\perl561\lib\CORE\perl56.lib libpng.lib zlib.lib D:\MS +VStudio\VC98\LIB\oldnames.lib D:\MSVStudio\VC98\LIB\kernel32.lib D:\M +SVStudio\VC98\LIB\user32.lib D:\MSVStudio\VC98\LIB\gdi32.lib D:\MSVSt +udio\VC98\LIB\winspool.lib D:\MSVStudio\VC98\LIB\comdlg32.lib D:\MSVS +tudio\VC98\LIB\advapi32.lib D:\MSVStudio\VC98\LIB\shell32.lib D:\MSVS +tudio\VC98\LIB\ole32.lib D:\MSVStudio\VC98\LIB\oleaut32.lib D:\MSVStu +dio\VC98\LIB\netapi32.lib D:\MSVStudio\VC98\LIB\uuid.libD:\MSVStudio\ +VC98\LIB\wsock32.lib D:\MSVStudio\VC98\LIB\mpr.lib D:\MSVStudio\VC98\ +LIB\winmm.lib D:\MSVStudio\VC98\LIB\version.lib D:\MSVStudio\VC98\LIB +\odbc32.lib D:\MSVStudio\VC98\LIB\odbccp32.lib D:\MSVStudio\VC98\LIB\ +msvcrt.lib -def:PNG.def Creating library blib\arch\auto\Tk\PNG\PNG.lib and object blib\arch +\auto\Tk\PNG\PNG.exp D:\perl561\bin\perl.exe -Id:\perl561\lib -Id:\perl561\lib -MEx +tUtils::Command -e chmod 755 blib\arch\auto\Tk\PNG\PNG.dll D:\perl561\bin\perl.exe -Id:\perl561\lib -Id:\perl561\lib -MEx +tUtils::Command -e cp PNG.bs blib\arch\auto\Tk\PNG\PNG.bs D:\perl561\bin\perl.exe -Id:\perl561\lib -Id:\perl561\lib -MEx +tUtils::Command -e chmod 644 blib\arch\auto\Tk\PNG\PNG.bs D:\WORK\PerlCompile\compile-modules\perl561\Tk-PNG-2.005>vc nmake test Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. D:\perl561\bin\perl.exe -Mblib -Id:\perl561\lib -Id:\perl561\l +ib -e "use Test::Harness qw(&runtests $verbose); $verbose=0; runtests + @ARGV;" t\basic.t Using d:/WORK/PerlCompile/compile-modules/perl561/Tk-PNG-2.005/blib t\basic.............ok All tests successful. Files=1, Tests=4, 2 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 C +PU)
and I even saw some picture on a screen. Honestly!

A few tips what were of concern here.

update: some HTML formating cleanup

Courage, the Cowardly Dog.

Replies are listed 'Best First'.
Re: Re: Compiling Tk::PNG on win32 (complications, more c/xs than perl)
by crazyinsomniac (Prior) on Jul 15, 2002 at 20:21 UTC
    Ok, I see what you're doing there, I get there, and then it goes downhill again,
    E:\dev\new\Tk-PNG-2.005>perl Makefile.PL E:/dev/new/Tk-PNG-2.005 does not start with C:/Perl/site/lib i.e. building outside Tk itself Finding dependancies for PNG.xs Finding dependancies for imgPNG.c Missing ')' trailing: x500) at C:/Perl/site/lib/Tk/MakeDepend.pm line 102, <./zlib +/zconf.h> line 95. Missing ')' trailing: x0500) && defined (WIN32) at C:/Perl/site/lib/Tk/MakeDepend. +pm line 102, <./zlib/zconf.h> line 178. Writing Makefile for Tk::PNG E:\dev\new\Tk-PNG-2.005>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. "Running Mkbootstrap for Tk::PNG ()" C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::C +ommand -e chmod 644 PNG.bs C:\Perl\bin\perl.exe "-IC:\Perl\lib" "-IC:\Perl\lib" -MExtUtil +s::Mksymlists -e "Mksymlists( 'NAME' => 'Tk::PNG', 'DLBASE' => 'PNG', 'DL_FUNCS' => { }, 'FUNCLIST' + => [], 'IMPORTS' => { }, 'DL _VARS' => []);" link -out:blib\arch\auto\Tk\PNG\PNG.dll -dll -nologo -nodefaul +tlib -release -libpath:"C:/Pe rl\lib\CORE" -machine:x86 PNG.obj imgPNG.obj C:\Perl\lib\CORE\perl +56.lib libpng.lib zlib.lib "C: \Program Files\Microsoft Visual Studio\VC98\lib\oldnames.lib" "C:\Prog +ram Files\Microsoft Visual Stu dio\VC98\lib\kernel32.lib" "C:\Program Files\Microsoft Visual Studio\V +C98\lib\user32.lib" "C:\Progra m Files\Microsoft Visual Studio\VC98\lib\gdi32.lib" "C:\Program Files\ +Microsoft Visual Studio\VC98\l ib\winspool.lib" "C:\Program Files\Microsoft Visual Studio\VC98\lib\co +mdlg32.lib" "C:\Program Files\ Microsoft Visual Studio\VC98\lib\advapi32.lib" "C:\Program Files\Micro +soft Visual Studio\VC98\lib\sh ell32.lib" "C:\Program Files\Microsoft Visual Studio\VC98\lib\ole32.li +b" "C:\Program Files\Microsoft Visual Studio\VC98\lib\oleaut32.lib" "C:\Program Files\Microsoft Visu +al Studio\VC98\lib\netapi32.li b" "C:\Program Files\Microsoft Visual Studio\VC98\lib\uuid.lib" "C:\Pr +ogram Files\Microsoft Visual S tudio\VC98\lib\wsock32.lib" "C:\Program Files\Microsoft Visual Studio\ +VC98\lib\mpr.lib" "C:\Program Files\Microsoft Visual Studio\VC98\lib\winmm.lib" "C:\Program Files\Mi +crosoft Visual Studio\VC98\lib \version.lib" "C:\Program Files\Microsoft Visual Studio\VC98\lib\odbc3 +2.lib" "C:\Program Files\Micro soft Visual Studio\VC98\lib\odbccp32.lib" "C:\Program Files\Microsoft +Visual Studio\VC98\lib\msvcrt. lib" -def:PNG.def Creating library blib\arch\auto\Tk\PNG\PNG.lib and object blib\arch +\auto\Tk\PNG\PNG.exp C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::C +ommand -e chmod 755 blib\arch\ auto\Tk\PNG\PNG.dll C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::C +ommand -e cp PNG.bs blib\arch\ auto\Tk\PNG\PNG.bs C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::C +ommand -e chmod 644 blib\arch\ auto\Tk\PNG\PNG.bs E:\dev\new\Tk-PNG-2.005>nmake test Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. C:\Perl\bin\perl.exe -Mblib -IC:\Perl\lib -IC:\Perl\lib -e "us +e Test::Harness qw(&runtests $ verbose); $verbose=0; runtests @ARGV;" t\basic.t Using E:/dev/new/Tk-PNG-2.005/blib t\basic....dubious Test returned status 5 (wstat 1280, 0x500) DIED. FAILED tests 2-4 Failed 3/4 tests, 25.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t\basic.t 5 1280 4 3 75.00% 2-4 Failed 1/1 test scripts, 0.00% okay. 3/4 subtests failed, 25.00% okay. NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2' Stop. E:\dev\new\Tk-PNG-2.005>
    at nmake test I get a stupid application error ( blah blah, the memory could not be read) </CODE>

     
    ______crazyinsomniac_____________________________
    Of all the things I've lost, I miss my mind the most.
    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

      Indeed, there were two exactly same places with that incompatibilities between Borland C++ and MSVC++ compilers, and I forgot to mention them earlier. In order to compile, I edited that file in error (zconf.h) in two places just to throw away a couple of lines for Borland compiler some version, so I stepped forward, and that was like a right direction.

      Seems to me like "MakeMaker" is to blame here. Although I saw following places:

      #if (defined(__BORLANDC__)&&(__BORLANDC__<=0x520)) \ || (defined(__MINGW32__) && !defined(_ANONYMOUS_UNION)) ....... #endif
      in perl source code distribution, which are essentially same as we faced.

      BTW do you wish for me to email my build directory for reference? It's ~1Mb in size.

      addition: may be we should prepare compatibility patch for miscellaneous compilers on win32 systems and sent it to author of a module?

      Courage, the Cowardly Dog