我正在尝试安装一些 Perl 模块,但是收到一个奇怪的错误:
sudo cpanm XML::Parser
cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc
make[1]: Entering directory `/root/.cpanm/work/1383241509.7912/XML-Parser-2.41/Expat'
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
/usr/bin/perl /usr/share/perl/5.14.2/ExtUtils/xsubpp -noprototypes -typemap /usr/share/perl/5.14/ExtUtils/typemap -typemap typemap Expat.xs > Expat.xsc && mv Expat.xs$
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVER$
Expat.xs:12:19: fatal error: expat.h: No such file or directory
compilation terminated.
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpanm/work/1383241509.7912/XML-Parser-2.41/Expat'
make: *** [subdirs] Error 2
-> FAIL Installing XML::Parser failed. See /root/.cpanm/work/1383241509.7912/build.log for details. Retry with --force to force install it.
我该如何解决这个问题?
答案1
我通过这个命令找到了解决方案apt-get
:
sudo apt-get install expat
sudo apt-get install libexpat1-dev