crazybilly crazybilly - 1 year ago 145
Perl Question

How to install DBI and other modules on msysgit (on Windows 7)?

I'm trying to install the DBI perl module on my Windows 7 machine, using Git for Windows, ie. msysgit, and the version of perl that ships with it.

I've been able to install a few other perl modules, but when I try to install DBI (via

perl -MCPAN -e "install DBI"
), the build process bombs out with the following error:

"/usr/bin/perl.exe" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -typemap "/usr/share/perl5/core_perl/ExtUtils/typemap" -typemap "typemap" Perl.xs > Perl.xsc && mv Perl.xsc Perl.c

gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"1.636\" -DXS_VERSION=\"1.636\" "-I/usr/lib/perl5/core_perl/CORE" -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c

In file included from DBIXS.h:23:0,
from Perl.xs:7:
C:/git-sdk-64/usr/lib/perl5/core_perl/CORE/perl.h:805:25: fatal error: sys/wait.h: No such file or directory
# include <sys/wait.h>
compilation terminated.
make: *** [Makefile:627: Perl.o] Error 1
/usr/bin/make -- NOT OK

I get a similar error when I try to install Text::CSV_XS.

Based on what I've read elsewhere, I'm assuming that I'm missing something in my build environment. I've installed all the development metapackages mentioned on the msysgit documentation without any luck.

I'm not opposed to somehow building the module without using cpan, but I don't know how to troubleshoot the error I'm getting, let alone take on building something new. Suggestions?

Answer Source

mysysgit does not provide a full build environment. Thus, the best solution is to install another version of Perl (Strawberry Perl or Active Perl, for example) and alter your path so that mysysgit uses that perl rather than the one that comes built in.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download