开发者
资源
鲲鹏环境编译fio报error: static declaration of ‘gettid’ follows错误解决方法
鲲鹏环境编译fio报error: static declaration of ‘gettid’ follows错误解决方法
发表于2023/08/20
1.8k7

【问题描述】

鲲鹏环境编译fio安装过程报error: static declaration of ‘gettid’ follows non-static declaration错误, 详细报错如下:

os/os-linux.h:108:19: error: static declaration of ‘gettid’ follows non-static declaration
  108 | static inline int gettid(void)
      |                   ^~~~~~
In file included from /usr/include/unistd.h:1204,
                 from gettime.c:5:
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
make: *** [Makefile:225: gettime.o] Error 1
ERROR: excute "make" failed, please check it.

【解决方法】

修改os/os-linux.h文件

将第108行的 static inline int gettid(void)

修改为 static inline int sys_gettid(void)

再次执行make编译即正常编译通过。

收藏举报
Level 1
0
帖子
0
粉丝
0
获赞