error: ‘mutex’ in namespace ‘boost’ does not name a type 解决办法

在ubuntu下使用make编译的时候出现错误:

error: ‘boost::mutex’ has not been declared

以及:

error: ‘mutex’ in namespace ‘boost’ does not name a type

等错误,原因是有可能是没有安装boost或者是没有添加boost头文件:

排查方法,首先查看是否安装boost:

dpkg -S /usr/include/boost/version.hpp  

返回结果是:

libboost1.71-dev:amd64: /usr/include/boost/version.hpp

证明是安装了boost了,附上安装boost的指令:

sudo apt-get install libboost-all-dev 

若系统安装了boost,在报错的.pp文件文件中添加:

#include <boost/thread/mutex.hpp>

抱错消失,编译成功。

相关推荐

  1. SpringBoot 循环引用解决办法

    2024-03-24 18:46:02       12 阅读
  2. 滴滴车型不符解决办法怎么办理

    2024-03-24 18:46:02       26 阅读
  3. git 提交文件过大 解决办法

    2024-03-24 18:46:02       35 阅读
  4. HTTP常见错误码原因以及解决办法

    2024-03-24 18:46:02       36 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-24 18:46:02       14 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-24 18:46:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-24 18:46:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-24 18:46:02       18 阅读

热门阅读

  1. trt | torch2trt的使用方式

    2024-03-24 18:46:02       18 阅读
  2. P7480 Reboot from Blue 线段树优化建图跑最短路

    2024-03-24 18:46:02       16 阅读
  3. 和neo4j相似的python工具

    2024-03-24 18:46:02       18 阅读
  4. 【2024-03-20】华为春招笔试三道编程题解

    2024-03-24 18:46:02       15 阅读
  5. C# System.Console.WriteLine的格式化输出

    2024-03-24 18:46:02       16 阅读
  6. C#面:简述可空类型

    2024-03-24 18:46:02       17 阅读
  7. 【2024-03-18】顺丰春招笔试两道编程题解

    2024-03-24 18:46:02       18 阅读
  8. 【串口开发】android 智能设备开发 知识笔记

    2024-03-24 18:46:02       20 阅读
  9. 学习笔记 | 微信小程序项目day06

    2024-03-24 18:46:02       22 阅读
  10. mysql基础02

    2024-03-24 18:46:02       14 阅读