大佬教程收集整理的这篇文章主要介绍了编译 MUD 时如何修复“gettimeofday”的冲突类型?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在 Ubuntu 机器上尝试使用 make 编译 MUD 的代码库时,出现以下错误:
comm.c:184:5: error: conflicTing types for ‘gettimeofday’
184 | int gettimeofday args( ( struct timeval *tp,struct timezone *tzp ) );
| ^~~~~~~~~~~~
In file included from comm.c:56:
/usr/include/x86_64-linux-gnu/sys/time.h:66:12: note: prevIoUs declaration of ‘gettimeofday’ was here
66 | extern int gettimeofday (struct timeval *__reStrict __tv,| ^~~~~~~~~~~~
这是错误来自的代码片段:
#if Defined(linuX)
/*int accept args( ( int s,struct sockaddr *addr,int *addrlen
) );*/
/*int bind args( ( int s,struct sockaddr *name,int namelen
) );*/
int close args( ( int fd ) );
int gettimeofday args( ( struct timeval *tp,struct timezone *tzp ) );
int Listen args( ( int s,int BACklog ) );
int read args( ( int fd,char *buf,int nbyte ) );
int SELEct args( ( int wIDth,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,struct timeval *timeout ) );
int socket args( ( int domain,int type,int protocol ) );
int write args( ( int fd,int nbyte ) );
#endif
我已尝试删除第二个参数,但我收到另一个错误,指出函数“gettimeofday”的参数过多。
我该如何解决这个问题?
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的编译 MUD 时如何修复“gettimeofday”的冲突类型?全部内容,希望文章能够帮你解决编译 MUD 时如何修复“gettimeofday”的冲突类型?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。