使用ns_initparse()函数C linux编译程序

时间:2009-11-06 16:49:24

标签: c linux dns bind

我已经安装了BIND。我在gcc中编译时使用-resolv作为参数。但它给出了错误:

/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/cck9LhAK.o: In function `resolvmx':
res.c:(.text+0x6b): undefined reference to `__ns_initparse'
res.c:(.text+0xda): undefined reference to `__ns_parserr'
res.c:(.text+0x11c): undefined reference to `__ns_sprintrr'
collect2: ld returned 1 exit status

1 个答案:

答案 0 :(得分:-1)

您忘记将main.o(或main.c)添加到链接行。