zhang@zhang-PC:~/Desktop/zhang$ ls
_mingw.h time.h zhal.c
zhang@zhang-PC:~/Desktop/zhang$ gcc zhal.c
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/time.h:39:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__MINGW_NOTHROW’
int __cdecl __MINGW_NOTHROW gettimeofday(struct timeval *__restrict__,
^~~~~~~~~~~~~~~
/usr/include/time.h:39:13: error: unknown type name ‘__MINGW_NOTHROW’
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:47:0,
from /usr/include/x86_64-linux-gnu/sys/types.h:219,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/x86_64-linux-gnu/bits/time.h:30:8: error: redefinition of ‘struct timeval’
struct timeval
^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/time.h:11:8: note: originally defined here
struct timeval {
^~~~~~~
zhang@zhang-PC:~/Desktop/zhang$
Reply Like 0 Favorite View the author
All Replies
linusboyle
deepin
2018-05-18 01:36
#1
为什么你的linux上会有mingw……
Reply Like 0 View the author
ritter
deepin
2018-05-18 15:26
#2
int __cdecl __MINGW_NOTHROW gettimeofday();完全没看懂这个函数是什么意思,c语言还有这种神奇的语法?int+两个不知道什么鬼的东西+函数名(),这到底是什么语法?
或许int__cdecl__MINGW_NOTHROW中间没有空格,是一个typedef struct{}int __cdecl __MINGW_NOTHROW,那就说得通了。
_mingw.h time.h zhal.c
zhang@zhang-PC:~/Desktop/zhang$ gcc zhal.c
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/time.h:39:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__MINGW_NOTHROW’
int __cdecl __MINGW_NOTHROW gettimeofday(struct timeval *__restrict__,
^~~~~~~~~~~~~~~
/usr/include/time.h:39:13: error: unknown type name ‘__MINGW_NOTHROW’
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:47:0,
from /usr/include/x86_64-linux-gnu/sys/types.h:219,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/x86_64-linux-gnu/bits/time.h:30:8: error: redefinition of ‘struct timeval’
struct timeval
^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
from /usr/include/stdlib.h:275,
from zhal.c:2:
/usr/include/time.h:11:8: note: originally defined here
struct timeval {
^~~~~~~
zhang@zhang-PC:~/Desktop/zhang$