ESP8266 Developer Zone The Official ESP8266 Forum 2015-09-24T10:10:17+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1127 2015-09-24T10:10:17+08:00 2015-09-24T10:10:17+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1127&p=3829#p3829 <![CDATA[Re: 关于FD_SET/FD_CLR的重复定义的问题]]>
麻烦提供您的测试代码,以供分析查证。

感谢您对 ESP8266 的关注!

Statistics: Posted by ESP_Faye — Thu Sep 24, 2015 10:10 am


]]>
2015-09-19T17:05:35+08:00 2015-09-19T17:05:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1127&p=3763#p3763 <![CDATA[关于FD_SET/FD_CLR的重复定义的问题]]> 我使用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

请帮忙解答一下!

Statistics: Posted by zsf518 — Sat Sep 19, 2015 5:05 pm


]]>