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

When I run cpan, ActivePerl 5.20 tells me that "It looks like you don't have a C compiler ..." and tries to download MinGW-4.6.3. I *do* have MinGW (gcc-4.8.1) installed in C:\MinGW with c:\MinGW\bin in my PATH. How do I make ActivePerl use my existing compiler?

Replies are listed 'Best First'.
Re: Make ActivePerl use existing compiler
by syphilis (Archbishop) on Aug 24, 2015 at 07:34 UTC
    I *do* have MinGW (gcc-4.8.1) installed in C:\MinGW with c:\MinGW\bin in my PATH

    Yes, I would have thought that would be sufficient.
    Do you also have 'dmake' installed and in your path ?
    (I'm merely wondering whether ActivePerl might be mistakenly equating the absence of 'dmake' with the absence of a compiler.)

    Cheers,
    Rob
      I don't have dmake.
        I don't have dmake

        I speculate that if you install 'dmake' and add it to your path, then cpan installs will happily use your gcc-4.8.1 (assuming, of course, that gcc-4.8.1 is also still in your path).
        I could be wrong, of course.

        Cheers,
        Rob
Re: Make ActivePerl use existing compiler
by davies (Monsignor) on Aug 24, 2015 at 10:48 UTC
Re: Make ActivePerl use existing compiler
by RonW (Parson) on Aug 24, 2015 at 17:13 UTC

    You said you have MinGW 4.8.1 installed and that the cpan command tried to install MinGW 4.6.3

    The cpan command maybe actually meant you have a compiler different from the one that Perl was built with.

    In general, it is better to compile XS modules with the same compiler, version and options as Perl itself. It may well be that an executable built with 4.6.3 can load modules built with 4.8.1 with no problems, but the cpan command may still be being conservative.

    FWIW, one of the reasons I like the Strawberry Perl distribution (when I have to run Perl on MS Windows) is that it includes a copy of the compiler tool chain used to build the distribution.

      I downloaded the Strawberry Perl portable version. It includes the MinGW compiler, but nothing is installed so it definitely would not mess up my existing MinGW installation, which was my fear when I saw "Downloading MinGW 4.6.3 ...". Thanks.
Re: Make ActivePerl use existing compiler (cpan?)
by Anonymous Monk on Aug 24, 2015 at 07:40 UTC

    That is not usually a message any "perl" would give

    The "cpan" program might do that , I can't exactly recall, so what program are you calling when you encounter said message?

      Perhaps the first four words of the OP's post gives you a clue: "When I run cpan ...".

      Premature optimization is the root of all job security