file included from /usr/include/stdio.h:74:0,
                 from opendir.c:2:
/usr/include/libio.h:302:3: error: unknown type name ‘size_t’
   size_t __pad5;
   ^
/usr/include/libio.h:305:67: error: ‘size_t’ undeclared here (not in a function)
   char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
                                                                   ^
/usr/include/libio.h:333:62: error: expected declaration specifiers or ‘...’ before ‘size_t’
 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
                                                              ^
/usr/include/libio.h:342:6: error: expected declaration specifiers or ‘...’ before ‘size_t’
      size_t __n);
      ^
/usr/include/libio.h:464:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
 extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
                   ^
In file included from opendir.c:2:0:
/usr/include/stdio.h:319:35: error: expected declaration specifiers or ‘...’ 

 

本人程序之后,发现这个错误,百思不得其解,后面编译了其他之前编好的程序,发现编译没问题,仔细看了编译报错的代码,发现是注释那里少了/**/ ,加上去就没问题了。到最后还是我们程序出了问题。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐