我找到有效的方案:
转自:https://blog.csdn.net/qq_23494915/article/details/78732389
方法:
在使用的项目属性->预处理器->添加“HAVE_STRUCT_TIMESPEC”。
=======================================================
其他未尝试的方法:
C2011 “timespec”:“struct”类型重定义
如题,pthread.h中报错:C2011 “timespec”:“struct”类型重定义
解决方法:
在
#if !defined( PTHREAD_H )
#define PTHREAD_H
下面加上
#define HAVE_STRUCT_TIMESPEC