关于FD_SET/FD_CLR的重复定义的问题

zsf518
Posts: 31
Joined: Thu Jul 30, 2015 3:24 pm

关于FD_SET/FD_CLR的重复定义的问题

Postby zsf518 » Sat Sep 19, 2015 5:05 pm

hi,
我使用RTOS版SDK, 版本是1.2.0。
程序中使用socket 的select功能,也使用了有关时间的函。
在编译的时候就报出 文件操作函数重复定义的错误。

也就是说 extra_include/sys/types.h和include/lwip/lwip/sockets.h两个文件里面有重复定义!

In file included from ../../extra_include/time.h:29:0,
from user_main.c:35:
../../extra_include/sys/types.h:226:0: error: "FD_SET" redefined [-Werror]
# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
^
In file included from user_main.c:18:0:
../../include/lwip/lwip/sockets.h:348:0: note: this is the location of the previ
ous definition
#define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7)))
^
In file included from ../../extra_include/time.h:29:0,
from user_main.c:35:
../../extra_include/sys/types.h:227:0: error: "FD_CLR" redefined [-Werror]
# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))

^
In file included from user_main.c:18:0:
../../include/lwip/lwip/sockets.h:349:0: note: this is the location of the previ
ous definition
#define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
^
In file included from ../../extra_include/time.h:29:0,
from user_main.c:35:
../../extra_include/sys/types.h:228:0: error: "FD_ISSET" redefined [-Werror]
# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))

^
In file included from user_main.c:18:0:
../../include/lwip/lwip/sockets.h:350:0: note: this is the location of the previ
ous definition
#define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7)))
^
In file included from ../../extra_include/time.h:29:0,
from user_main.c:35:
../../extra_include/sys/types.h:229:0: error: "FD_ZERO" redefined [-Werror]
# define FD_ZERO(p) (__extension__ (void)({ \
^
In file included from user_main.c:18:0:
../../include/lwip/lwip/sockets.h:351:0: note: this is the location of the previ
ous definition
#define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p)))
^
user_main.c: In function 'GetTime_task':
user_main.c:4290:3: error: passing argument 2 of 'lwip_select' from incompatible
pointer type [-Werror]
if (select(time_fd + 1, &wfds, NULL, NULL, &sockselect) > 0)
^
In file included from user_main.c:18:0:
../../include/lwip/lwip/sockets.h:393:5: note: expected 'struct fd_set *' but ar
gument is of type 'struct _types_fd_set *'
int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *excepts
et,
^
cc1: all warnings being treated as errors
../../Makefile:337: recipe for target '.output/eagle/debug/obj/user_main.o' fail
ed
make[2]: *** [.output/eagle/debug/obj/user_main.o] Error 1

请帮忙解答一下!

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: 关于FD_SET/FD_CLR的重复定义的问题

Postby ESP_Faye » Thu Sep 24, 2015 10:10 am

您好,

麻烦提供您的测试代码,以供分析查证。

感谢您对 ESP8266 的关注!

Who is online

Users browsing this forum: No registered users and 27 guests