PHP

编译安装libXpm报错

报错详情如下:

checking if gcc supports-Werror=attributes... yes
./configure: line 14556: --print-errors: command not found
checking whether make supports nested variables... (cached) yes
checking for strlcat... no
checking for XPM... no
configure: error: in `/data/soft/php/libXpm-3.5.12':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables XPM_CFLAGS
and XPM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

请问这个问题有谁遇到过,怎么解决?

已邀请:

Nock - 万物本平等,无奈现实俗!

1. 尝试安装or更新pkg-config:
# ubuntu
apt-get install -y pkg-config

# Centos
yum install -y pkgconfig

2. 在configure之前设置相关变量:
export XPM_CFLAGS="-I/data/app/libxpm/include" XPM_LIBS="-L/data/app/libxpm/lib -lXpm"
根据你的报错提示。

要回复问题请先登录注册