‘mutex’ in namespace ‘std’ does not name a type

在Windows的vs中使用std::mutex没有问题,将代码迁移到ubuntu上后报错:‘mutex’ in namespace ‘std’ does not name a type

解决方法:加上头文件

#include <thread>
#include <mutex>
#include <unistd.h>
posted @ 2020-11-06 15:05  maycpou  阅读(8792)  评论(0)    收藏  举报