Perl MakeMaker - how to force Perl linking with the static C library (libcrt.lib) instead of dynamic

Hi,

I'm building a Perl extension (dll in Windows XP) using
ExtUtils::MakeMaker.
This dll needs to link with other libraries that were built in static
mode (-MTd).
My perl configuration states dynamic libraries (-MD) which causes
MakeMaker to pull a dynamic C library (msvcrtd.dll).
The other libraries are using the static C library (libcmtd.lib)
These dynamic and static C libraries collide giving link errors.

Is there a way to force perl to compile with (-MTd) albeit its
configuration flags?
I tried reinstalling Perl (ActiveState perl v5.8.8 built for MSWin32-
x86-multi-thread) but didn't see an option to control the
configuration flags.
Also, my platform supports both dynamic (-MD) and static (-MTd)
builds. Does this mean that I have to maintain two versions of Perl?


Thanks,

Avner
Avi [ Di, 17 April 2007 23:22 ] [ ID #1690540 ]

Re: Perl MakeMaker - how to force Perl linking with the static Clibrary (libcrt.lib) instead of dyna

Avi wrote:
> Hi,
>
> I'm building a Perl extension (dll in Windows XP) using
> ExtUtils::MakeMaker.
> This dll needs to link with other libraries that were built in static
> mode (-MTd).
> My perl configuration states dynamic libraries (-MD) which causes
> MakeMaker to pull a dynamic C library (msvcrtd.dll).
> The other libraries are using the static C library (libcmtd.lib)
> These dynamic and static C libraries collide giving link errors.
>
> Is there a way to force perl to compile with (-MTd) albeit its
> configuration flags?
> I tried reinstalling Perl (ActiveState perl v5.8.8 built for MSWin32-
> x86-multi-thread) but didn't see an option to control the
> configuration flags.
> Also, my platform supports both dynamic (-MD) and static (-MTd)
> builds. Does this mean that I have to maintain two versions of Perl?
>
>
> Thanks,
>
> Avner
>

Have you tried:
perl Makefile.PL LINKTYPE=static
nmake

(perldoc -m ExtUtils::MakeMaker|grep LINKTYPE)

regards,
Reinhard

--
PM Mails an rpirpag <at> gmx dot at
Reinhard Pagitsch [ Do, 19 April 2007 10:41 ] [ ID #1692769 ]
Perl » comp.lang.perl.modules » Perl MakeMaker - how to force Perl linking with the static C library (libcrt.lib) instead of dynamic

Vorheriges Thema: Issues with Proc::ProcessTable module on Solaris 9
Nächstes Thema: Tk::PlotDataset v1.00