写在前面
自己的环境:Ubuntu 16.04, ros-kinetic
一、报错信息
编译程序时报错:
By not providing "FindGflags.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Gflags", but
CMake did not find one.
Could not find a package configuration file provided by "Gflags" with any
of the following names:
GflagsConfig.cmake
gflags-config.cmake
Add the installation prefix of "Gflags" to CMAKE_PREFIX_PATH or set
"Gflags_DIR" to a directory containing one of the above files. If "Gflags"
provides a separate development package or SDK, be sure it has been
installed.
显然,这是缺少 gflags
,需要安装 gflags
。
二、解决方法
- 首先下载
glog
:https://github.com/gflags/gflags
,我这里下载的是v2.2.2
- 解压:
unzip gflags-2.2.2.zip
- 然后编译安装
cd gflags-2.2.2/
mkdir build
cd build/
cmake ..
make
sudo make install
接下来再次编译程序,就OK了~