要运行ORB_SLAM2之前,安装pangolin出现的错误

本文记录了在编译Pangolin过程中遇到的一系列错误,主要涉及C++11特性未启用导致的问题,如override、final关键字及std库元素使用错误等。作者建议使用旧版本代码以避免此类编译错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在网上的大部分教程中,都是先去github上的pangolin最新版本下载。之后再进行一系列依赖库的安装,再cmake … ,make, make install。

然而,在上述github上的pangolin最新版本的CMAKE工程下安装的make过程总是出一大堆的错误,齐刷刷地非常多。

错误信息大概是这样:

/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/assert.h:50:3: note: suggested alternative:
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/assert.h:45:6: note:   ‘pangolin::abort’
 void abort(const char* function, const char* file, int line, Args&&... args)
      ^
In file included from /home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:28:0:
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h: At global scope:
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:64:61: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
     std::streamsize xsputn(const char * s, std::streamsize n) override;
                                                             ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:67:23: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
     int overflow(int c) override;
                       ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:72:5: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
     ) override;
     ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:75:20: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
     int filenum = -1;
                    ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:88:5: error: ‘mutex’ in namespace ‘std’ does not name a type
     std::mutex update_mutex;
     ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:89:5: error: ‘condition_variable’ in namespace ‘std’ does not name a type
     std::condition_variable cond_queued;
     ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:90:5: error: ‘condition_variable’ in namespace ‘std’ does not name a type
     std::condition_variable cond_dequeued;
     ^
/home/chenww/Desktop/Pangolin-master/include/pangolin/utils/threadedfilebuf.h:91:5: error: ‘thread’ in namespace ‘std’ does not name a type
     std::thread write_thread;
     ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp: In member function ‘void pangolin::threadedfilebuf::open(const string&, size_t)’:
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:90:5: error: ‘write_thread’ was not declared in this scope
     write_thread = std::thread(std::ref(*this));
     ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:90:20: error: ‘thread’ is not a member of ‘std’
     write_thread = std::thread(std::ref(*this));
                    ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:90:32: error: ‘ref’ is not a member of ‘std’
     write_thread = std::thread(std::ref(*this));
                                ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp: In member function ‘void pangolin::threadedfilebuf::close()’:
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:97:5: error: ‘cond_queued’ was not declared in this scope
     cond_queued.notify_all();
     ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:99:8: error: ‘write_thread’ was not declared in this scope
     if(write_thread.joinable())
        ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp: In member function ‘virtual std::streamsize pangolin::threadedfilebuf::xsputn(const char*, std::streamsize)’:
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:138:9: error: ‘unique_lock’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
         ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:138:26: error: ‘mutex’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
                          ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:138:43: error: ‘update_mutex’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                           ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:138:55: error: ‘lock’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                                       ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:141:13: error: ‘cond_dequeued’ was not declared in this scope
             cond_dequeued.wait(lock);
             ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:153:9: error: ‘unique_lock’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
         ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:153:26: error: ‘mutex’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
                          ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:153:43: error: ‘update_mutex’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                           ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:153:55: error: ‘lock’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                                       ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:157:13: error: ‘cond_dequeued’ was not declared in this scope
             cond_dequeued.wait(lock);
             ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:182:5: error: ‘cond_queued’ was not declared in this scope
     cond_queued.notify_one();
     ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp: In member function ‘virtual int pangolin::threadedfilebuf::overflow(int)’:
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:193:9: error: ‘unique_lock’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
         ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:193:26: error: ‘mutex’ is not a member of ‘std’
         std::unique_lock<std::mutex> lock(update_mutex);
                          ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:193:43: error: ‘update_mutex’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                           ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:193:55: error: ‘lock’ was not declared in this scope
         std::unique_lock<std::mutex> lock(update_mutex);
                                                       ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:197:13: error: ‘cond_dequeued’ was not declared in this scope
             cond_dequeued.wait(lock);
             ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:209:5: error: ‘cond_queued’ was not declared in this scope
     cond_queued.notify_one();
     ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp: In member function ‘void pangolin::threadedfilebuf::operator()()’:
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:248:13: error: ‘unique_lock’ is not a member of ‘std’
             std::unique_lock<std::mutex> lock(update_mutex);
             ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:248:30: error: ‘mutex’ is not a member of ‘std’
             std::unique_lock<std::mutex> lock(update_mutex);
                              ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:248:47: error: ‘update_mutex’ was not declared in this scope
             std::unique_lock<std::mutex> lock(update_mutex);
                                               ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:248:59: error: ‘lock’ was not declared in this scope
             std::unique_lock<std::mutex> lock(update_mutex);
                                                           ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:252:17: error: ‘cond_queued’ was not declared in this scope
                 cond_queued.wait(lock);
                 ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:273:13: error: ‘unique_lock’ is not a member of ‘std’
             std::unique_lock<std::mutex> lock(update_mutex);
             ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:273:30: error: ‘mutex’ is not a member of ‘std’
             std::unique_lock<std::mutex> lock(update_mutex);
                              ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:273:47: error: ‘update_mutex’ was not declared in this scope
             std::unique_lock<std::mutex> lock(update_mutex);
                                               ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:273:59: error: ‘lock’ was not declared in this scope
             std::unique_lock<std::mutex> lock(update_mutex);
                                                           ^
/home/chenww/Desktop/Pangolin-master/src/utils/threadedfilebuf.cpp:282:9: error: ‘cond_dequeued’ was not declared in this scope
         cond_dequeued.notify_all();
         ^
make[2]: *** [src/CMakeFiles/pangolin.dir/utils/threadedfilebuf.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2
make: *** [all] Error 2

解决方法:用旧版本的代码!!!https://github.com/zzx2GH/Pangolin.git

解决方法:用旧版本的代码!!!

解决方法:用旧版本的代码!!!

解决方法:用旧版本的代码!!!

解决方法:用旧版本的代码!!!

参见:https://blog.youkuaiyun.com/zzu_seu/article/details/84866858

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值