stevenlovegrove/Pangolin: Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input. (github.com)https://github.com/stevenlovegrove/Pangolin现在latest版本是v0.8,装了很多次都报错,于是装v0.6
Release →v0.6→Assets→Source code(tar.gz)
下载好了在常用的文件夹中解压,确定装好环境依赖后按照Building流程走
cmake -B build
cmake --build build
报错1:pybind/embed.h没有那个文件或目录
原因是下载时直接通过压缩包下载而非通过git clone --recursive递归下载
vim .gitmodules
查看文件的内容
[submodule "external/pybind11"]
path = external/pybind11
url = https://github.com/pybind/pybind11.git
根据文件内容下载需要的pybind,首先打开external文件夹,里面有一个名为pybind11的空文件夹,将其删除后重新下载pybind11
git clone https://github.com/pybind/pybind11.git
下载完成后再次cmake --build build仍会提示没有那个文件或目录,此时需要将pybind11/include添加到src/CMakelists.txt的搜索路径中。打开Pangolin-0.6/src/CMakelists.txt,在里面添加你的pybind11/include的绝对路径
include_directories("/home/siat/Pangolin-0.6/external/pybind11/include")
报错2:error: 'numeric_limits' is not a member of 'std'
根据提示打开Pangolin-0.6/include/pangolin/gl/colour.h,添加头文件limits
#include <limits>
然后就编译完成了
别忘了进入build文件夹中安装一下哦
sudo make install