Pangolin安装报错解决
视觉SLAM十四讲$3.7节需要。
参考readme,git clone到本地
git clone https://github.com/stevenlovegrove/Pangolin.git
首先需要安装OpenGL
以及Cmake、C++11等,
然后建立build文件夹,在内部编译:
mkdir build
cd build
cmake ..
make
不出意外的话,会报错:
include/pangolin/utils/picojson.h:383:12: note: in definition of macro ‘GET’ 383 | return var;
include/pangolin/utils/picojson.h:390:124: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 390 | ->type_ = number_type, const_cast(this)->u_.number_ = u_.int64_ ), u_.number_))
我改动了几个文件,然后通过编译了。具体改动是:
#include
#include
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
#ifdef PICOJSON_USE_INT64
GET(double,(type_ == int64_type && ((const_cast(this)->type_ = number_type), (const_cast(this)->u_.number_ = u_.int64_)),u_.number_))
GET(int64_t, u_.int64_)