gpt4 book ai didi

c - OpenBSD 上的 给出不完整的类型错误

转载 作者:行者123 更新时间:2023-11-30 17:05:21 32 4
gpt4 key购买 nike

我的ssl bindings for R在 linux、osx、windows 和 solaris 上编译,但在 OpenBSD 上包含 resolv.h 时会失败。这是 OpenBSD 中的错误吗?我应该(不)首先包含一些其他 header 吗?

egcc -std=gnu99 -I/usr/local/lib/R/include -DNDEBUG -I/usr/include -I/usr/local/include    -fpic  -O2 -pipe  -c ssl.c -o ssl.o
In file included from ssl.c:14:0:
/usr/include/resolv.h:137:3: error: array type has incomplete element type
nsaddr_list[MAXNS]; /* address of name server */
^
/usr/include/resolv.h:147:18: error: field 'addr' has incomplete type
struct in_addr addr;
^
/usr/include/resolv.h:164:19: error: field 'ina' has incomplete type
struct in_addr ina;
^
/usr/include/resolv.h:165:20: error: field 'in6a' has incomplete type
struct in6_addr in6a;
^
/usr/local/lib/R/etc/Makeconf:134: recipe for target 'ssl.o' failed
gmake: *** [ssl.o] Error 1

最佳答案

评论中给出了正确答案:

#include <netinet/in.h>
#include <resolv.h>

关于c - OpenBSD 上的 <resolv.h> 给出不完整的类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35359456/

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