wxwidget可以apt-get install libwx(tab)来安装,也可以源码安装,后面那个--disable-shared建议不要
配置:./configure --with-gtk --enable-unicode --disable-shared
编译:make
安装(root用户):
sudo make install
配置下环境变量usr/local/lib 如果之前配置过 可以省略,具体网上查
sudo ldconfig
这样编译完后
再编译mrpt
编译mrpt就是简单的
cmake ..
make
的时候可能会出现的错误
can not be used when making a shared object; recompile with -fPIC
有人的建议是改成
make CXXFLAGS=-fplc CFLAGS=-fplc
但是不行
有人说改成
cmake --disable-shared ..
因为说这个--disabe-shared是要传递的,这个参数意思就是编译为静态库使用
后面我想到wxwidget中的编译选项中有--disable-shared
然后去掉了wxwidget的编译选项中的--disabe-shared 就ok了
编译的时候出现的警告
[ 53%] Building CXX object libs/maps/CMakeFiles/maps.dir/src/maps/COccupancyGridMap2D_likelihood.cpp.o
In file included from /opt/ros/kinetic/include/octomap/OcTreeBaseImpl.h:83:0,
from /opt/ros/kinetic/include/octomap/OccupancyOcTreeBase.h:44,
from /opt/ros/kinetic/include/octomap/ColorOcTree.h:40,
from /home/cai/mrpt/mrpt/libs/maps/src/maps/CColouredOctoMap.cpp:12:
/opt/ros/kinetic/include/octomap/OcTreeIterator.hxx: In constructor ‘octomap::OcTreeBaseImpl<NODE, I>::iterator_base::iterator_base(const octomap::OcTreeBaseImpl<NODE, I>*, uint8_t)’:
/opt/ros/kinetic/include/octomap/OcTreeIterator.hxx:56:9: warning: declaration of ‘tree’ shadows a member of ‘octomap::OcTreeBaseImpl<NODE, I>::iterator_base’ [-Wshadow]
: tree((tree && tree->root) ? tree : NULL), maxDepth(depth)
最后mrpt成功编译了,但是出现的警告是我有史以来见过最多的
然后可以跑一下mrpt的build的bin目录下的一些程序
网友评论