Here is the solution. Note that I was building version 1.00 for various reasons but the same procedure should work for 1.01. I was using ActiveState 5.10.0 build 1004 and MSVC 2005 Pro.

Replace the Module::Build Makefile.PL with an EU::MM one:

#!/usr/bin/perl use strict; use ExtUtils::MakeMaker qw(WriteMakefile); my @INC = (' -Isrc -Iinclude'); WriteMakefile( NAME => 'Encode::Detect::Detector', VERSION_FROM => 'Detector.pm', PREREQ_PM => {}, ABSTRACT_FROM => 'Detector.pm', AUTHOR => '', INC => join(' ', @INC), C => [ glob 'src/*.cpp Detector.c' ], H => [ glob 'src/*.h' ], OBJECT => q/$(O_FILES)/, );
Run Makefile.PL with CC var to enable C++ mode:
$ perl Makefile.PL CC="cl -TP" $ nmake
This will fail because it's looking for *.obj files in the src directory but they were built in the main directory.
$ copy *.obj src $ nmake
This will compile everything, but not copy Encode/Detect.pm to the correct place.
$ copy Detect.pm blib\lib\Encode $ nmake test
Done! There is almost certainly a way within Makefile.PL to work around the last 2 issues, but I didn't want to spend any more time on it.


In reply to Re: Cannot compile Encode::Detect on Windows by agrundma
in thread Cannot compile Encode::Detect on Windows by gvr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.