Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Win32::API now installs from the CPAN shell

Journal written by cosimo (4138) and posted by brian_d_foy on 2006.12.23 15:26   Printer-friendly

The latest version of Win32::API, marked v0.46, should now correctly install even from the CPAN shell. Finally!

There is a fair amount of work behind, but now it should build, test and install cleanly on all major platform and compiler combinations.
In short, the build of API_test.dll is now gone. In the 0.46 package there's a pre-built library compiled with MSVC 6, that happens to work smoothly when loaded by any Win32::API flavour. The test suite is now simpler and takes compiler/environment differences into account.

I directly tested it on:

  • Source-compiled perl 5.8.8 + MSVC 6 + nmake
  • Source-compiled perl 5.8.8 + MSVC 2003 (Free toolkit) + nmake
  • Strawberry perl + MinGW GCC + GNU make
  • Strawberry perl + MinGW GCC + dmake
  • Cygwin perl + gcc + GNU make

Obviously there are lots of problems and improvements possible:

  • For example, it'd be great to investigate why gcc built the (now gone) test dll without all kernel32.lib imports...
  • Also, why functions with double or float return values always segfault when called.
  • And last but not least, callback interface works fully only under MSVC 6.

I don't know now when I'll find the time to go on with this work, but for now, have fun!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I've tried test COSIMO/Win32-API-0.46.tar.gz in the CPAN shell on the two platforms I have available, and it kind of works... but both seem to fall over a secundary test somewhere. The same one.
    1. ActivePerl 5.8.8 build 817 (Mar 20 2006) + MinGW gcc 3.2.3. ActivePerl depends on ActivePerl::Config to dynamically override settings in Config.

      C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, '..
      \blib\lib', '..\blib\arch')" t/*.t
      t/02_Callback....ok 1/8# Compiler name:cl
      # Compiler version:12
      # $

    • Hi Bart, this is interesting. Thanks for your time.

      • ActivePerl 5.8.8 + Gcc

        AFAIK, ActivePerl comes compiled by MSVC6, which is cl.exe version 12, but you are using with gcc. Correct?

        In the Callback tests, which btw fail unless you have MSVC6, I needed a way to check the compiler and I used $Config{ccname} and $Config{ccversion} instead of only using $Config{cc}, because I only must distinguish between MSVC 6 and 7+.

        Can you report your cc, ccname and ccversion variables? Or better, file a bug on

  • Works smoothly on Strawberry Perl. I've updated it on the Vanilla Perl Problem Modules page on Thank you very much for all your work on this!

  • All tests successful.
    This is perl, v5.8.7 built for MSWin32-x86-multi-thread