Subject: | Build error when using non-standard libxml2 installation |
Date: | Mon, 22 Oct 2012 03:00:25 -0700 |
To: | bug-XML-LibXML [...] rt.cpan.org |
From: | L RW <lrw4400 [...] att.net> |
I ran into a build problem when trying to link to a libxml2 that had been installed into a non-standard location.
XML::LibXML version 2.00007
uname: Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
Perl: 5.10.1
The error I got upon running perl Makefile.PL was:
libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
After various efforts to rebuild libxml2, I started to think that it was actually installed correctly all along and that the Makefile.PL wasn't finding it properly for some reason. After digging a bit I found that adding "LIBS => $config{LIBS}" to the call to check_lib fixed the problem. The call to Devel::CheckLib::check_lib was returning false because it didn't know to look in the right directory for the library. I also added "debug => $config{DEBUG}" to the same call FYI, it might come in handy as well.
Not sure if this is really a Makefile bug or if there was a different way I could have resolved the issue, but I figured I'd mention it just in case. Thanks for a great module!