zabbix 1.1beta1, gcc 3.3.6
when --enable-static is used, compilation fails :
./configure --enable-agent --enable-static && make
...
gcc -static -g -O2 -o zabbix_agent zabbix_agent.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcommon/libzbxcommon.a
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0xcb3): In function `PROC_NUM':
common/common.c:769: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0x1377): In function `forward_request':
common/common.c:1328: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0x2326): In function `CHECK_DNS':
: undefined reference to `__res_query'
collect2: ld returned 1 exit status
make[3]: *** [zabbix_agent] Error 1
1. doesn't requirement to have the same glibc libraries eliminate the reason to compile static binaries at all ?
2. what causes "undefined reference to `__res_query'" ?
when --enable-static is used, compilation fails :
./configure --enable-agent --enable-static && make
...
gcc -static -g -O2 -o zabbix_agent zabbix_agent.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcommon/libzbxcommon.a
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0xcb3): In function `PROC_NUM':
common/common.c:769: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0x1377): In function `forward_request':
common/common.c:1328: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../libs/zbxsysinfo/libzbxsysinfo.a(common.o)(.text+0x2326): In function `CHECK_DNS':
: undefined reference to `__res_query'
collect2: ld returned 1 exit status
make[3]: *** [zabbix_agent] Error 1
1. doesn't requirement to have the same glibc libraries eliminate the reason to compile static binaries at all ?
2. what causes "undefined reference to `__res_query'" ?

Comment