gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 18:14:41 47 4
gpt4 key购买 nike

我已经安装了 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

最佳答案

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

关于使用 ns_initparse() 函数编译程序 C linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1688862/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com