g2o 编译问题

error: No rule to make target libqglviewer.so

No rule to make target /usr/lib/libqglviewer.so, needed by ../lib/libg2o_viewer.so

solution

由于libqglviewer库与编译源文件不匹配, 寻找给github上g2o更早的版本. 其中一个可用的版本, csdn下载地址:
http://download.csdn.net/detail/ziqian0512/9850720

error: ‘Qt::WFlags’ has not been declared

/usr/include/QGLViewer/qglviewer.h:102:76: error: ‘Qt::WFlags’ has not been declared
  explicit QGLViewer(QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0);
/usr/include/QGLViewer/qglviewer.h:103:97: error: ‘Qt::WFlags’ has not been declared
  explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0);
/usr/include/QGLViewer/qglviewer.h:104:101: error: ‘Qt::WFlags’ has not been declared
  explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WFlags flags=0);

solution

将出错的文件中Qt::WFlags 改成 Qt::WindowFlags

error: undefined reference to `g2o::csparse_extension

undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)'
undefined reference to `g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const*, double*, cs_di_symbolic const*, double*, int*)'
undefined reference to `g2o::csparse_extension::writeCs2Octave(char const*, cs_di_sparse const*, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** Error 1
make[1]: *** Error 2
make[1]: *** Waiting for unfinished jobs....
undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)'
 undefined reference to `g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const*, double*, cs_di_symbolic const*, double*, int*)'
undefined reference to `g2o::csparse_extension::writeCs2Octave(char const*, cs_di_sparse const*, bool)'
collect2: error: ld returned 1 exit status
make[2]: ***  Error 1
make[1]: *** Error 2
undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)'
 undefined reference to `g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const*, double*, cs_di_symbolic const*, double*, int*)'
/home/taiping/graphslam_ws/devel/lib/libgaussianslam.so: undefined reference to `g2o::csparse_extension::writeCs2Octave(char const*, cs_di_sparse const*, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/taiping/graphslam_ws/devel/lib/gaussianslam_ros/gaussianslam_pc] Error 1
make[1]: *** [gaussianslam_ros/CMakeFiles/gaussianslam_pc.dir/all] Error 2
/home/taiping/graphslam_ws/devel/lib/libgaussianslam.so: undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_di_sparse const*, cs_di_symbolic const*, int*, double*)'
/home/taiping/graphslam_ws/devel/lib/libgaussianslam.so: undefined reference to `g2o::csparse_extension::cs_cholsolsymb(cs_di_sparse const*, double*, cs_di_symbolic const*, double*, int*)'
......
......
......Error 1
make[1]: *** Error 2
make: *** [all] Error 2
Invoking "make -j6 -l6" failed

solution

重新,重新很重要…gluNewQuadric
重新安装 libsuitesparse-dev
重新编译 g2o

sudo apt-get install libsuitesparse-dev
cd g2o/build/
cmake ..
make
sudo make install

可能有些地方不对,我重新编译了两遍才解决.

error: libQGLViewer.so: undefined reference to

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluNewQuadric'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluUnProject'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluCylinder'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluPickMatrix'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluSphere'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libQGLViewer.so: undefined reference to `gluProject'
collect2: error: ld returned 1 exit status
make[3]: *** [../bin/g2o_viewer] Error 1

solution

libqglviewer 安装
http://libqglviewer.com/installUnix.html

error: By not providing “FindEigen.cmake”

By not providing “FindEigen.cmake” in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by “Eigen”, but CMake did not find one. Could not find a package configuration file provided by “Eigen” with any of the following names:
EigenConfig.cmake
eigen-config.cmake

将其加入到ROS中出现的问题, 例子见https://github.com/rosskidson/g2o_tutorial.

solution

   # package.xml
   <build_depend>cmake_modules</build_depend>
   <run_depend>cmake_modules</run_depend> # this line was not described on the website
   # CMakeFiles.txt
   find_package(cmake_modules REQUIRED)

无法安装libqglviewer-qt4-dev包

在网址 http://ftp.debian.org/debian/pool/main/libq/libqglviewer/,下载libqglviewer-dev-common_2.3.4-4.2_all.deb, libqglviewer-qt4-2_2.3.4-4.2_amd64.deb, libqglviewer-qt4-dev_2.3.4-4.2_amd64.deb

sudo  dpkg -i libqglviewer-dev-common_2.3.4-4.2_all.deb
sudo  dpkg -i libqglviewer-qt4-2_2.3.4-4.2_amd64.deb
sudo  dpkg -i libqglviewer-qt4-dev_2.3.4-4.2_amd64.deb

error: liblapack.so: undefined reference to

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.so: undefined reference to `ATL_scopy'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.so: undefined reference to `ATL_stpsv'
......
......
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.so: undefined reference to `ATL_zger2c'
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/constant_velocity_target] Error 1
make[1]: *** [g2o/examples/target/CMakeFiles/constant_velocity_target.dir/all] Error 2
make: *** [all] Error 2

solution

sudo apt-get install libblas-dev liblapack-dev

or

下载liblapack-dev_3.5.0-2ubuntu1_amd64.deb安装

http://packages.ubuntu.com/trusty/amd64/liblapack-dev/download 
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值