----- Original Message -----
From: "Ingy dot Net" <[EMAIL PROTECTED]>
To: "Todd H" <[EMAIL PROTECTED]>
Cc: <inline@perl.org>
Sent: Saturday, April 28, 2007 9:05 PM
Subject: Re: Use gcc with Inline::C
On 19/04/07 13:11 -0700, Todd H wrote:
Hi,
I have Microsoft Visual C++ 6.0 installed and am using
Inline:CC with PERL. My questions is, can I use GNU
"gcc" instead of VC++ to compile my Inline C code? Is
this a trivial change?
In general you need to use the same compiler that compiled your Perl. If
you
have ActivePerl, I think this is MSVC++6. At least it used to be...
Yes - ActiveState still build their 32-bit perls using MSVC++ 6.0. But
recent versions, from build 815 (I think) up to the current 820, allow the
use of MinGW's gcc compiler and dmake. It all happens automatically and
seamlessly, based on whether dmake and MinGW are found in the path. If
they're found then an alternate %Config is set up - one that contains the
appropriate values for dmake and MinGW.
It works just like ExtUtils::FakeConfig, only it happens seamlessly.
It works fine with Inline::C (assuming Inline::C was built with
dmake/MinGW). One small problem (which, faik, may have been addressed in
build 820) is that the new %Config sets 'ld' to 'gcc' instead of to 'g++'
and this creates problems with Inline::CPP. It also creates problems when
trying to build any module that contains C++ code. The solution is simple -
just go into the ActivePerl/Config.pm and change 'ld's assignment to 'g++'.
There were also some other Config values that were not set to ideal values.
Probably best to use the values that ExtUtils::FakeConfig assigns (where
they differ from the values that ActiveState have assigned). EU::FC does an
excellent job of it. I can't fault it, except that it doesn't work
automatically - you have to explicitly load it with the '-MConfig_m' option.
(Actually, having installed EU::FC you can 'set perl5opt=-MConfig_m', and
the the fake Config gets loaded whenever 'perl' is run - no need to
explicitly load Config_m.pm.)
Cheers,
Rob