Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML::Parser refusing to install

I've been trying to install XML::Simple on Ubuntu 12.10 for the past two hours or so and have officially run out of ideas. It's failing at the XML::Parser.

I've done an

sudo apt-get install expat

and it still did not work. Here's the error I've been getting:

make[1]: Entering directory `/home/<user>/.cpan/build/XML-Parser-2.41-MCLo7T/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.xsc Expat.c
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   -DVERSION=\"2.41\" -DXS_VERSION=\"2.41\" -fPIC "-I/usr/lib/perl/5.14/CORE"   Expat.c
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 `/home/sclarawu/.cpan/build/XML-Parser-2.41-MCLo7T/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible

Seems to be telling me that it's unable to find expat.h, but I'm not sure why or how, considering expat is installed? I tried to apt expat-devel, but it appears not to be a package in apt. Any ideas would be greatly appreciated. :)

EDIT: I seemed to have been simply trying to install the wrong package. -.- It's always the little things. Much thanks to those who answered!

like image 447
user1496777 Avatar asked Dec 21 '12 07:12

user1496777


3 Answers

Another way to get to the same information which @Moritz Bunkus has pointed out above.

ubuntu:~$ apt-cache search expat 
expat - XML parsing C library - example application 
libexpat1 - XML parsing C library - runtime library 
libexpat1-dev - XML parsing C library - development kit

The third one in the result set is what you are looking for.

like image 191
Bee Avatar answered Nov 09 '22 11:11

Bee


Adding to the other answers, here's how to install the expat dependency on CentOS/RHEL:

yum install expat-devel
like image 29
Banjer Avatar answered Nov 09 '22 11:11

Banjer


You need to install the Expat library and its development headers. For DebUbuntu this means libexpat1-dev as well as those distros often split their libraries into two packages: one for the runtime components (shared libraries, data files, general documentation), one for the development components (static libraries, header files, development documentation).

like image 14
Moritz Bunkus Avatar answered Nov 09 '22 10:11

Moritz Bunkus