ramtek has asked for the wisdom of the Perl Monks concerning the following question:
More of a statement than a question but I have seen the question enough to share. Compiling Win32::AdminMisc is a pain (especially for Perl 5.10. There were a few steps to it and although posts I have seen on here are helpful they aren't complete. Here are the steps I had to take to be able to compile Win32::AdminMisc on Win32 perl 5.10 running on Windows XP SP3 (a ghetto tutorial) :
Install ActiveState Perl 5.10 installed (duh)
Install Microsoft Visual Studio 6
Install Microsoft Visual Studio 6 SP5
Install Microsoft Visual Studio C++ 6.0 Processor Pack
Install Microsoft Platform SDK for Windows XP SP2
Unzip source code for Admin::Misc unzipped somewhere (will create an include directory). I unzipped it to C: since Roth's code seems to like this for some reason. If you encounter whining about an S drive and a missing directory and you have no drive S just do a "net use s: \\%computername%\c$" so it can make whatever it needs and continue.
Change Line 87 of your Win32Perl.h to "#if PERL_VERSION >= 8" as advised in another perlmonks post (lost the link)
Copy CUString.lib and CUString.hpp (you can get them from Win32-Scheduler_v20000702.tar) to the include directory created when you unzipped your source code
Once all that is done you can compile. %PERL510% in my case c:\perl510 and %SDK% is "C:\Program Files\Microsoft Platform SDK for Windows XP SP2".
Notice you are using the Lib folder under the SDK install not the one installed with Visual Studio.
If you don't reference KERNEL32.LIB on the command line you will see GlobalMemoryStatusEx errors (which are highly annoying)
Here is my full working build line . . . second thought why not just finish it off with a batch :
Watch the line wraps. This should get anyone trying to do this to the point where they are just gathering files and not having to work hard to get back to what they had in Perl 5.8.REM COMPILE WIN32::ADMINMISC set BASE_DIR=c: set SDK=C:\Program Files\Microsoft Platform SDK for Windows XP SP2 set PERL510=c:\perl510 cd %BASE_DIR% cl -MT -LD -EHsc -I"%SDK%\Include" -I"%PERL510%\lib\CORE" -I"%BASE_DIR +%\include" -I"%BASE_DIR%" -DWIN32 -DPERL5008 adminmisc.cpp CDNS.cpp C +FunMap.cpp constant.cpp DNS.CPP CPUID.C Speed.c WinCPUID.c CUString.l +ib WinCPUIDlib.lib \lib\Accounts_Lite.lib %PERL510%\lib\CORE\perl510. +lib "%SDK%\Lib\USER32.LIB" "%SDK%\Lib\ADVAPI32.LIB" "%SDK%\Lib\WSOCK3 +2.LIB" "%SDK%\Lib\KERNEL32.LIB" "%SDK%\Lib\NETAPI32.LIB" "%SDK%\Lib\W +INMM.LIB" "%SDK%\Lib\VERSION.LIB" ADMINMISC.DEF /link /nodefaultlib:l +ibc echo Installing Win32::AdminMisc mkdir %PERL510%\site\lib\Win32 copy %BASE_DIR%\AdminMisc.pm %PERL510%\site\lib\Win32\ >nul mkdir %PERL510%\site\lib\auto\Win32\AdminMisc<br> copy %BASE_DIR%\AdminMisc.dll %PERL510%\site\lib\auto\Win32<br>\AdminM +isc\ >nul echo #!%PERL510%\bin\perl.exe -w > %BASE_DIR%\test.pl echo eval { use Win32::AdminMisc; }; if ($@){ print "Win32::AdminMisc +didn't load : $@\n"; } else { print "Win32::AdminMisc loaded ok\n"; } + exit 1; >> %BASE_DIR%\test.pl perl %BASE_DIR%\test.pl
I'm a bit surprised that Dave Roth doesn't maintain a ppd for this module since his book which is excellent for Windows Admins uses it extensively. Hopefully this helps someone.
-Matt
|
|---|