【问题标题】:Not found z library when compiling zabbix-server编译zabbix-server时找不到z库
【发布时间】:2026-01-24 23:05:02
【问题描述】:

我在 CentOS 6.2 上编译 zabbix-server 时遇到问题。 命令行是:

./configure --enable-server --with-mysql --with-net-snmp --with-libcurl 
--with-jabber --with-ssh2 --with-openipmi --with-ldap --enable-static

但出现错误:

checking for main in -lz... no
configure: error: Not found z library;

完整的配置输出在这里:http://pastebin.ru/WmDP7UL0

我已经尝试过:

yum install zlib zlib-devel zlib-static zlibrary zlibrary-devel

但是没有成功。

感谢您的关注。

UPD。此处发布的配置日志:http://pastebin.ru/WNtQu9eR 并显示此错误:

configure:7366: checking for main in -lz
configure:7385: gcc -o conftest -g -O2  -rdynamic  -static conftest.c -lz  -lm -lrt  -lresolv >&5
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status

【问题讨论】:

标签: linux configure


【解决方案1】:

这是实际的错误:

/usr/bin/ld: cannot find -lm

但它之前发现的,它指向别的东西。检查您的 ulimit 以确保您的最大打开文件数不低。

【讨论】:

  • 感谢您的回答。 yum install glibc-static 帮助我。但现在我不知道如何处理这个错误:checking for main in -lssl... no configure: error: Not found ssl library。我已经安装了 openssl 和 openssl-devel。它没有帮助。