ch3 编译visualizeGeometry.cpp报错pangolin编译出错
我在3rdparty中把pangolin的源码clone下来了,然后到ch3下进行make 就出错了,请各位帮忙看看怎么解决?
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1504:46: error: ‘m_slots’ was not declared in this scope
for (auto &group : detail::cow_write(m_slots)) {
^~~~~~~
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1504:46: note: suggested alternative: ‘m_block’
for (auto &group : detail::cow_write(m_slots)) {
^~~~~~~
m_block
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base< , >::add_slot(sigslot::signal_base< , >::slot_ptr&&)’:
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1538:42: error: ‘m_slots’ was not declared in this scope
auto &groups = detail::cow_write(m_slots);
^~~~~~~
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1538:42: note: suggested alternative: ‘m_block’
auto &groups = detail::cow_write(m_slots);
^~~~~~~
m_block
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::disconnect_if(Cond&&)’:
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1560:42: error: ‘m_slots’ was not declared in this scope
auto &groups = detail::cow_write(m_slots);
^~~~~~~
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1560:42: note: suggested alternative: ‘m_block’
auto &groups = detail::cow_write(m_slots);
^~~~~~~
m_block
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1564:28: error: range-based ‘for’ expression of type ‘auto’ has incomplete type
for (auto &group : groups) {
^~~~~~
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base< , >::clear()’:
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1584:27: error: ‘m_slots’ was not declared in this scope
detail::cow_write(m_slots).clear();
^~~~~~~
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1584:27: note: suggested alternative: ‘m_block’
detail::cow_write(m_slots).clear();
^~~~~~~
m_block
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp: In instantiation of ‘void sigslot::signal_base< , >::operator()(U&& ...) [with U = {pangolin::VarState::Event}; Lockable = std::mutex; T = {pangolin::VarState::Event}]’:
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_vars/include/pangolin/var/varstate.h:264:23: required from ‘std::map<std::__cxx11::basic_string, std::shared_ptrpangolin::VarValueGeneric >::iterator pangolin::VarState::AddUpgradedVar(const std::shared_ptr<pangolin::VarValue<T> >&, const iterator&, bool) [with T = bool; std::map<std::__cxx11::basic_string, std::shared_ptrpangolin::VarValueGeneric >::iterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string, std::shared_ptrpangolin::VarValueGeneric > >]’
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_vars/include/pangolin/var/varstate.h:205:13: required from ‘std::shared_ptrpangolin::VarValueGeneric pangolin::VarState::GetOrCreateVar(const T&, const pangolin::VarMeta&) [with T = bool]’
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_vars/include/pangolin/var/var.h:83:50: required from ‘pangolin::Var<T>::Var(const T&, const pangolin::VarMeta&) [with T = bool]’
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_vars/include/pangolin/var/var.h:88:35: required from ‘pangolin::Var<T>::Var(const string&, const T&) [with T = bool; std::__cxx11::string = std::__cxx11::basic_string]’
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_display/include/pangolin/display/widgets.h:153:50: required from here
/home/zhuft/readbook/slambook2/3rdparty/Pangolin/components/pango_core/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope
cow_copy_type<list_type, Lockable> ref = slots_reference();
~~~~~~~~~~~~~~~^~
examples/CMakeFiles/plotTrajectory.dir/build.make:79: recipe for target 'examples/CMakeFiles/plotTrajectory.dir/plotTrajectory.cpp.o' failed
make[2]: *** [examples/CMakeFiles/plotTrajectory.dir/plotTrajectory.cpp.o] Error 1
CMakeFiles/Makefile2:256: recipe for target 'examples/CMakeFiles/plotTrajectory.dir/all' failed
make[1]: *** [examples/CMakeFiles/plotTrajectory.dir/all] Error 2
Makefile:100: recipe for target 'all' failed
make: *** [all] Error 2

同样的问题,ubuntu20.04,有兄弟知道怎么解决吗?
我已经解决了
- 重新完整clone项目
git clone --recursive https://github.com/gaoxiang12/slambook2.git
- 安装所有依赖
sudo apt install -y libglew-dev libpng-dev python3-dev
- 重新编译安装
cd slambook2/3rdparty/Pangolin
mkdir build && cd build
cmake .. && make && sudo make install
- 编译ch3并运行
如果是使用原作者的库,需要先运行./scripts/install_prerequisites.sh --dry-run recommended
安装依赖后编译安装
Thanks!
从 Windows 版邮件发送
发件人: HakureiSK
发送时间: 2022年3月17日 14:10
收件人: gaoxiang12/slambook2
抄送: snowman-maker; Comment
主题: Re: [gaoxiang12/slambook2] ch3 编译visualizeGeometry.cpp报错pangolin编译出错 (Issue #222)
我已经解决了
- 重新完整clone项目
git clone --recursive https://github.com/gaoxiang12/slambook2.git
- 安装所有依赖
sudo apt install -y libglew-dev libpng-dev python3-dev
- 重新编译安装
cd slambook2/3rdparty/Pangolin
mkdir build && cd build
cmake .. && make && sudo make install
4. 编译ch3并运行
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.Message ID: @.***>
如果c++11不行就换c++14,总有一个能过,安装前依赖一定要装好
如果c++11不行就换c++14,总有一个能过,安装前依赖一定要装好
感谢回答,问题已经解决,此处的正确方法是,按照高翔老师给出的readme.txt中的命令安装Pangolin,因该不会报错,但是编译VisualizeGeometry.cpp报错,解决方式是修改ch3中的CmakeList.txt,将编译器标准由C++11改为C++14,可以正常编译,而不是修改Pangolin的CmakeList.txt,我的编译器是gcc9.4.0。
第二版书主要在17-18年写作,很难预料到未来编译环境里的一些问题,大家可能需要多尝试尝试。