in reply to MingW C for XS in ActiveState

++ for syphilis and ikegami. Your comments forced me to go back, install dmake (which I didn't think I needed) and learn a valuable lesson not learned after reading Compiling C/C++ based Modules under ActiveState using MinGW (ironically posted by syphilis).

SOLUTION:

Since I do some C work, I already have Dev-Cpp (http://bloodshed.net) installed (thus MingW gcc in C:\Dev-cpp\bin in my path). However, the 'make.exe' installed with Dev-cpp is not liked by ActiveState Perl - it asks for 'dmake.exe' specifically; however, we know MS 'nmake.exe' works "well" also. I downloaded MS 'nmake.exe' to be able to do the:

perl Makefile.PL make make test make install

and the Microsoft 'nmake.exe' (in place of 'make' in the above example) works fine with ActiveState with or without a C compiler installed (as one isn't needed) for simple Perl modules (that is, ones without XS C compile required). However for more complicated modules - that is - ones that require a C compiler for XS components, it *IS* essential that you match your make utility and your C compiler.

After taking the comments into consideration, I did a:

ppm install dmake

I then moved 'nmake.exe' out of my path. I added 'C:\Perl\site\bin' (where 'dmake.exe' was installed) to the end of my path (which already had 'C:\Dev-cpp\bin' among other things). Now, a:

perl Makefile.PL dmake dmake test dmake install

Worked fine - using the C:\Perl\Site\bin\dmake.exe and C:\Dev-cpp\bin\* C utilities (compiler, linker, DLL tools). My XS module compiled fine - as expected.

LESSON:

When doing module compiles involving C code, make (pun intended) sure your make utility and C compiler "match". That is:

seem to work best. Note, these are probably not the only make/C utilities available, they are just the combinations I've 'tested' during this experience.

Replies are listed 'Best First'.
Re^2: MingW C for XS in ActiveState
by Anonymous Monk on Feb 19, 2010 at 15:32 UTC
    Or
    ppm install MinGW dmake
    and be finished
Re^2: MingW C for XS in ActiveState
by syphilis (Archbishop) on Feb 19, 2010 at 23:23 UTC
    it *IS* essential that you match your make utility and your C compiler

    Actually, it's essential that you match your make utility with what perl -V:make reports.

    I've just built PDL-2.4.6 and a couple of other XS modules using nmake and MinGW without any problems. The tricky bit when building with gcc and nmake on ActivePerl would be making sure that perl -V:make reports 'nmake', not 'dmake'. (I actually didn't manage to achieve that with AS build 1007, though I think it could be done quite readily with some of the earlier AS builds.)

    Anyway ... good that you've now got things working, and in a sane and reliable way.

    Cheers,
    Rob