问题描述
在 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 (将#修改为@)