近来在研究PL-SLAM时,由于要安装stvo-pl库,所以我下载安装了这个库。在编译阶段我遇到了一个让人头大的问题。



即红框标出的地方报错:error: ‘random_device’ was not declared in this scope

在查阅了一大批博客无果后,我终于在一篇博客里发现了极其类似的问题,明白了是C++版本问题导致的报错

参考博客:https://blog.csdn.net/xingdou520/article/details/84861274

如果你在编译阶段出现过类似的问题,编译报错后提示如何修改,请不要盲目按照它说的修改,因为大部分时候,这并不奏效。你可以考虑是不是由于版本问题导致的。

根据参考博客所说,我添加了一行头文件,编译成功。

#include<bits/stdc++.h>



其实这一行就是C++的万能头,他包含了很多常用的头文件,我们一般想偷懒可以使用万能头。像上面遇到的这种情况很难找到缺少了哪一个头文件,所以索性使用万能头。

编译stvo-pl报错error: ‘random_device’ was not declared in this scope 解决方案的更多相关文章

  1. 编译android4.4 报错error: call to '__property_get_too_small_error' declared with attribute 的处理 (转载)

    转自:http://blog.csdn.net/syhost/article/details/14448899 完整的报错为: system/core/include/cutils/propertie ...

  2. IDEA报错Error running ‘Application‘: Command line is too long解决方案

    IDEA报错Error running 'Application': Command line is too long.Shorten command line for Application or ...

  3. 编译binutil包报错 error: array type has incomplete element type extern const struct relax_type md_relax_table[];

    安装lfs时编译binutils出错: ../../sources/binutils-2.15.91.0.2/gas/config/tc-i386.h:457:32: error: array typ ...

  4. 报错:tr was not declared in this scope

    报错代码如下: label->setText(tr("您好,Qt5.5.0!")); 修改为: label->setText(QObject::tr("您好, ...

  5. codeblocks中报错:'to_string' was not declared in this scope解决方案

    在windows下使用codeblocks(编译器采用MinGW)时,有时会遇到"'to_string' was not declared in this scope"的错误,这里 ...

  6. 【我的Android进阶之旅】解决Center OS 64位系统编译Android APP报错error=2和finished with non-zero exit value 127

    一.错误描述 1.问题 java.io.IOException: error=2, 没有那个文件或目录 今天在刚重新搭建好的64位的Center OS上安装好了Android SDK,Jenkins, ...

  7. gcc编译的时候报错 error trying to exec 'cc1plus': execvp 解决方法

    sudo apt install --reinstall build-essential -y

  8. ubuntu 编译C++ error: ‘syscall’ was not declared in this scope

    明明已经加了头文件 #include <sys/syscall.h> #include <sched.h> #include <sys/resource.h> 编译 ...

  9. 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory

    运行编译后的程序报错  error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...

  10. wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法

    内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...

随机推荐

  1. Java面试知识点(二)super 和 this 关键字

    this this 是自身的一个对象,代表对象本身,可以理解为:指向对象本身的一个指针. this 的用法在 java 中大体可以分为 3 种: 普通的直接引用 这种就不用讲了,this 相当于是指向 ...

  2. 深入探索 Nuxt3 Composables:掌握目录架构与内置API的高效应用

    title: 深入探索 Nuxt3 Composables:掌握目录架构与内置API的高效应用 date: 2024/6/23 updated: 2024/6/23 author: cmdragon ...

  3. C语言:不定长结构体的实现方式

    需求 有时候,我们会遇到一些情况:数据前部分相同,但是后部分长度不固定:数据格式相似,只是尾缀的长度不同,例如某些数据包,需要不定长度. 为了能够同时使用上不同长度的数据.可以用以下的方式实现. 方案 ...

  4. [UG 二次开发 python ] 截图,并用 opencv 显示出来

    需要 numpy,cv2 截图,去除背景,只显示主要部分 # nx: threaded from typing import Dict import NXOpen import numpy as np ...

  5. QT自定义右键菜单

    利用QMenu和QAction可以实现非常实用的右键菜单功能.具体实现思路如下: 1.在xxx.h文件中添加如下头文件 #include <QMenu> #include <QCon ...

  6. 实现ASP.Net Core3.1运行在DockeDesktop下并用Nginx实现负载均衡

    一.首先去https://docs.docker.com/get-docker/下载Windows版本的Docker Desktop并安装(需要win10专业版以上操作系统,并启用CPU虚拟化和安装H ...

  7. Golang 切片作为函数参数传递的陷阱与解答

    作者:林冠宏 / 指尖下的幽灵.转载者,请: 务必标明出处. GitHub : https://github.com/af913337456/ 出版的书籍: <1.0-区块链DApp开发实战&g ...

  8. 算法金 | 秒懂 AI - 深度学习五大模型:RNN、CNN、Transformer、BERT、GPT 简介

    1. RNN(Recurrent Neural Network) 时间轴 1986年,RNN 模型首次由 David Rumelhart 等人提出,旨在处理序列数据. 关键技术 循环结构 序列处理 长 ...

  9. wangEditor增加源码模式,添加查看源码功能

    wangEditor是一款轻量级的富文本编辑器.使用还比较方便,但是缺少查看源码模式,需要我们自定义一个menu给增加查看源码模式 下面是wangEditor增加源码模式的代码: <!DOCTY ...

  10. CF466E Information Graph 题解

    题目链接 Luogu Codeforces 题意简述 某公司中有 \(n\) 名员工.为方便起见,将这些员工从 1 至 \(n\) 编号.起初,员工之间相互独立.接下来,会有以下 \(m\) 次操作: ...