CentOS Linux Configure: error: *** neither libexpat not libbsdxml could be found ***
While running a configure script to eventually compile an application during testing on CentOS Linux I received an error stating that libexpat and/or libbsdxml could not be found. On CentOS you will only need to install libexpat-devel as shown in the below example following the output of the configure error and how we located what package installed libexpat via yum.
Configure Error On CentOS Linux:
configure: error: *** neither libexpat not libbsdxml could be found ***
Once the above error was displayed following a failed configure attempt I used “yum whatprovides” to see what package in the installed yum repositories installed libexpat as shown in the below example output.
Locate RPM Packages That Installed libexpat:
[root@dev ~]# yum whatprovides *libexpat* Loaded plugins: fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * base: centos.netnitco.net * epel: mirror.steadfast.net * extras: mirror.steadfast.net * rpmforge: ftp-stud.fht-esslingen.de * updates: mirror.rackspace.com harbour-contrib-3.0.0-11.el6.x86_64 : Contributed tools for Harbour Repo : atrpms Matched from: Filename : /usr/lib64/harbour/libexpat.a compat-expat1-1.95.8-8.el6.x86_64 : A library for parsing XML documents Repo : base Matched from: Filename : /usr/lib64/libexpat.so.0 Filename : /usr/lib64/libexpat.so.0.5.0 Other : libexpat.so.0()(64bit) expat-devel-2.0.1-9.1.el6.x86_64 : Libraries and header files to develop applications using expat Repo : base Matched from: Filename : /usr/lib64/libexpat.so Filename : /usr/lib64/libexpat.a expat-2.0.1-9.1.el6.x86_64 : An XML parser library Repo : base Matched from: Filename : /lib64/libexpat.so.1 Filename : /lib64/libexpat.so.1.5.2 Other : libexpat.so.1()(64bit) expat-2.0.1-9.1.el6.x86_64 : An XML parser library Repo : installed Matched from: Filename : /lib64/libexpat.so.1 Filename : /lib64/libexpat.so.1.5.2 Other : libexpat.so.1()(64bit) [root@dev ~]#
In my case expat was already installed but I needed to install expat-devel since the libraries needed to compile are included in that RPM package. Below is example output from installing expat-devel using YUM on CentOS Linux.
Install expat-devel On CentOS Linux:
[root@dev ~]# yum install expat-devel Loaded plugins: fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * base: centos.netnitco.net * epel: mirror.steadfast.net * extras: mirror.steadfast.net * rpmforge: ftp-stud.fht-esslingen.de * updates: mirror.symnds.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package expat-devel.x86_64 0:2.0.1-9.1.el6 set to be updated --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================== Installing: expat-devel x86_64 2.0.1-9.1.el6 base 119 k Transaction Summary ===================================================================================================================================================== Install 1 Package(s) Upgrade 0 Package(s) Total download size: 119 k Installed size: 475 k Is this ok [y/N]: y Downloading Packages: expat-devel-2.0.1-9.1.el6.x86_64.rpm | 119 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : expat-devel-2.0.1-9.1.el6.x86_64 1/1 Installed: expat-devel.x86_64 0:2.0.1-9.1.el6 Complete! [root@dev ~]#
While I did run into other issues when running the cofnigure script I no longer received the error specified at the beginning of the article after installing expat-devel.