wherrera has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am using an ActiveState version of Perl built under Win32 with MS C 12. I am attempting to build modules under a newly installed Visual C 9.0 (actually MSC version 15) compiler. Currently the builds work, but I have to manually fix the generated DLL by running the Miscrosoft mt.exe utility to bind the run-time library to the .dll file, due to the questionably advised changes to Visual C++ in the past few years to allow multiple dll versions to peacfully co-exist in Windows :-( There should be some place in the ActiveState Perl configuration to add this so that Extutils:: MakeMaker will add the call to "mt -manifest ..." correctly to the generated Makefile. Anyone know where this goes?

Replies are listed 'Best First'.
Re: Visual C 9.0 and dll hell
by BrowserUk (Patriarch) on May 10, 2008 at 01:31 UTC
      Thanks! That did _not_ fix the problem, but pointed me via the code in those lines (the patch is already there in my version) to where the current version of MakeMaker reads the compiler version from the file "config_heavy.pl", which was where I had to change things. That gets the mt program to run, properly I hope...thanks!
        To (perhaps) answer the question you raised in your initial post to this thread, the following patch to lib/ActivePerl/Config.pm would (afaict) take care of the whole thing for you:
        --- Config.pm_orig Mon Jul 23 13:49:44 2007 +++ Config.pm Sat May 10 19:33:34 2008 @@ -81,7 +81,11 @@ } if ($COMPILER_ENV{$key} && !$compiler_env_initialized++) { - if ($^O eq "MSWin32" && (_gcc_requested() || !find_prog(_orig_con +f("cc")))) { + if ($^O eq "MSWin32" && !_gcc_requested() && find_prog(_orig_c +onf("cc"))) { + my @ccversion = split / /, `cl 2>&1`; + _override("ccversion", $ccversion[7]); + } + elsif ($^O eq "MSWin32" && (_gcc_requested() || !find_prog(_orig_ +conf("cc")))) { if (my $gcc = find_prog("gcc")) { # assume MinGW or similar is available $gcc =~ s,\\,/,g;
        I'm not sure that's the best way to determine the compiler version, and I'm not even sure that my logic is correct anyway, but it doesn't seem to break anything for me, and it should override the existing $Config{ccversion} with the appropriate value.

        I'll submit it as a bug report to ActiveState. They'll probably want to change my code (if they decide to implement the fix), but at least it demonstrates that only a minor amendment to lib/ActivePerl/Config.pm is necessary in order to have the whole thing dealt with automatically.

        Cheers,
        Rob
        Update: As of ActiveState build 1003 lib/ActivePerl/Config.pm has been patched to fix the problem that was the basis of the thread. (Unsurprisingly, the patch applied was not exactly the same as the one provided above.)
Re: Visual C 9.0 and dll hell
by dk (Chaplain) on May 11, 2008 at 21:14 UTC
    Last year I was banging my head against the same issue, and found nothing of practical use. I've finally abandoned MSVC use except where it was version 6 ( ActiveState distributes binaries built by this version, because distribution of code produced by higher version is also a nightmare story on its own). Otherwise, I've switched to strawberry perl, which uses gcc/mingw.