【发布时间】:2019-03-14 22:43:16
【问题描述】:
我已经用 c 开发了大约 6 个月,我对这里发生的事情感到非常困惑。尝试包含 socket.h 头文件时出现此错误。
static inline int close(int sock)
{
return zsock_close(sock);
}
这是它似乎有问题的方法?我从构建中取回了这个。
In file included from /home/jordan/zephyr/zephyr/include/posix/pthread.h:13:0,
from /home/jordan/thrift/src/c/zephyr/mbedtlstest/../../../../include/thrift/os.h:10,
from /home/jordan/thrift/src/c/zephyr/mbedtlstest/../../../../include/thrift/types.h:4,
from /home/jordan/thrift/src/c/zephyr/mbedtlstest/../../../../include/thrift/ssl/../transport.h:4,
from /home/jordan/thrift/src/c/zephyr/mbedtlstest/../../../../include/thrift/ssl/transport.h:4,
from /home/jordan/thrift/src/c/ssl/transport.c:1:
/home/jordan/zephyr/zephyr/include/posix/unistd.h:21:12: note: previous declaration of ‘close’ was here
【问题讨论】:
-
你不能将你的函数命名为
close。该名称已被占用。 -
试试
close(int sock)-->JD_close(int sock)
标签: c zephyr-rtos