Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- No preference for use of exported glog CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported glog CMake configuration if available.
-- Failed to find installed glog CMake configuration, searching for glog build directories exported with CMake.
-- Failed to find an installed/exported CMake configuration for glog, will perform search for installed glog components.
——————————————————————————————————————————————————————
By not providing "FindCeres.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Ceres", but
CMake did not find one.
Could not find a package configuration file provided by "Ceres" with any of
the following names:
CeresConfig.cmake
ceres-config.cmake
Add the installation prefix of "Ceres" to CMAKE_PREFIX_PATH or set
"Ceres_DIR" to a directory containing one of the above files. If "Ceres"
provides a separate development package or SDK, be sure it has been
installed.
原因:Ceres库未正确安装。
参考链接:
https://www.cnblogs.com/qilai/p/13654810.html
http://ceres-solver.org/installation.html
安装Ceres库之前首先要安装依赖项:
// CMake sudo apt-get install cmake // google-glog + gflags sudo apt-get install libgoogle-glog-dev libgflags-dev // BLAS & LAPACK sudo apt-get install libatlas-base-dev // Eigen3 sudo apt-get install libeigen3-dev // SuiteSparse and CXSparse (optional) sudo apt-get install libsuitesparse-dev //以下几个也建议检查一下 sudo apt-get install liblapack-dev sudo apt-get install libsuitesparse-dev sudo apt-get install libcxsparse3.1.2 sudo apt-get install libgtest-dev
出现了无法定位libcxsoarse3.1.2的问题,解决方法如下:
//第一步,打开sources.list sudo gedit /etc/apt/sources.list //第二步,将下面的源粘贴到最上方sources.list deb http://cz.archive.ubuntu.com/ubuntu trusty main universe //第三步,更新源 sudo apt-get update //第四步,重新输入依赖项安装命令安装依赖项 sudo apt-get install libcxsparse3.1.2
然后再安装Ceres
//手动下载文件然后复制过来也行,效果一样的 git clone https://ceres-solver.googlesource.com/ceres-solver tar zxf ceres-solver-2.0.0.tar.gz mkdir ceres-bin cd ceres-bin cmake ../ceres-solver-2.0.0 make -j3 make test // Optionally install Ceres, it can also be exported using CMake which // allows Ceres to be used without requiring installation, see the documentation // for the EXPORT_BUILD_DIR option for more information. make install
Ceres和C++版本不匹配的问题:
刚才安装的Ceres版本是2.0.0,其编译默认是C++14。我这个CMakeList.txt里用的还是C++11所以报错了,把11改成14就OK了。找到你们自己要编译的东西,打开配置文件检查一下。



