【问题标题】:Compiling program with ns_initparse() function C linux使用 ns_initparse() 函数 C linux 编译程序
【发布时间】:2009-11-06 16:49:24
【问题描述】:

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

/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

【问题讨论】:

标签: c linux dns bind


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-14
    • 1970-01-01
    • 1970-01-01
    • 2017-10-01
    • 2010-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多