静态链接的GDB无法在目标远程服务器中使用主机名

静态链接的GDB无法在目标远程服务器中使用主机名,gdb,static-linking,gethostbyname,Gdb,Static Linking,Gethostbyname,GDB基于RHEL-4.7构建。我在RHEL-6.3上运行GDB。如果GDB是动态链接的,那么一切正常。如果GDB是静态链接的,我得到 (gdb) target remote :2107 localhost: unknown host :2107: No such file or directory. 当静态构建GDB时,我们收到一条警告消息: warning: Using 'gethostbyname' in statically linked applications requires a

GDB基于RHEL-4.7构建。我在RHEL-6.3上运行GDB。如果GDB是动态链接的,那么一切正常。如果GDB是静态链接的,我得到

(gdb) target remote :2107
localhost: unknown host
:2107: No such file or directory.
当静态构建GDB时,我们收到一条警告消息:

warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

我也用谷歌搜索过,似乎gethostbyname依赖于glibc库。我试图在RHEL-6.3上安装兼容的glibc库。但是没有运气。有什么提示吗?

最后,我想出来了。我必须打开nscd服务。