天天看点

《视觉SLAM十四讲》第九讲-运行程序出现Segmentation fault (core dumped)、double free or corruption (out)解决方法写在前面一、问题一及解决方法二、问题二及解决方法参考链接

写在前面

运行《视觉SLAM十四讲》第九讲中的0.2版本、0.3版本、0.4版本出现的报错

一、问题一及解决方法

1. 问题描述

编译通过,但是运行时出现以下报错:

2. 解决方法

config.cpp

中的

void Config::setParameterFile( const std::string& filename )

函数中,将下列语句

修改为

static cv::FileStorage file1( filename.c_str(), cv::FileStorage::READ );
config_->file_ = file1;
           

二、问题二及解决方法

1. 问题描述

编译通过,但是运行时出现以下报错:

double free or corruption (out)
Aborted (core dumped)
           

2. 解决方法

CMakeLists.txt

中的下列语句

修改为

参考链接

[1] 风衣格木. 关于视觉SLAM十四讲第九章0.2中在执行run_vo时出现Segmentation fault (core dumped)时解决方法 [EB/OL]. https://blog.csdn.net/sinat_39720504/article/details/102481421, 2019-10-10/2022-12-21.

继续阅读