in reply to Re: Cannot compile Encode::Detect on Windows
in thread Cannot compile Encode::Detect on Windows

The file compiles clean ... if you add option -TP to cause the compiler to treat the file as C++ .

Easiest way to achieve that is to start the build process with perl Makefile.PL CC="cl -TP".
For me, that allows Encode-Detect-1.01 to build ok (though I first had to copy the 2 header files that are in the 'include' folder into the 'src' folder). However, I strike runtime problems when running the test suite:
Can't locate loadable object for module Encode::Detect::Detector
I haven't the time at the moment to take a look at what's going wrong there. It's the same problem if I build with MinGW (starting with perl Makefile.PL CC="g++").

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: Cannot compile Encode::Detect on Windows
by BrowserUk (Patriarch) on Apr 17, 2009 at 13:52 UTC

    That adds the -TP to the compiler commands for every file, rather than just the one that needs it. In this case, that doesn't seem to prevent the rest from compiling ok, but is that always true?

    But I don't see how to use that syntax to remove unneeded options?

    Didn't you see all the noise and errors that I'm seeing at the linker stage?

    Using response files instead of huge command lines is a step forward over EU::MM--but automatically deleting them so the programmer cannot look to see what options were used and perhaps try adjusting them, before sitting down to try and work out how to pursuade build.pl to produce what you've discovered works, is three steps backward.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Didn't you see all the noise and errors that I'm seeing at the linker stage?

      Yes - I see the same as you. Last night I didn't have much time to investigate - tonight I *do* have the time, but it looks to me that we're dealing with Module::Build issues, and that means I don't have the inclination. (It's not a matter of not caring ... rather a matter of wanting to avoid the feelngs of extreme annoyance that invariably arise within me whenever I *do* investigate Module::Build.)

      Coming up with a solution that involves only ExtUtils::MakeMaker and that works on Windows does, however, strike me as the sort of exercise that I ought to do. (It will probably be no less aggravating than investigating Module::Build ;-)

      Cheers,
      Rob