RainerKuemmerle / g2o

g2o: A General Framework for Graph Optimization
3.08k stars 1.11k forks source link

Build error on ubuntu 20.04 #794

Open Lky0724 opened 5 months ago

Lky0724 commented 5 months ago

I am trying to build g2o on ubuntu 20.04 using following command:

mkdir build
cd build
cmake ../
make

But I always encounter following error when I execute 'make' order:

/usr/bin/ld: CMakeFiles/slam2d_g2o.dir/slam2d_viewer.cpp.o: in function g2o::Slam2DViewer::Slam2DViewer(QWidget*, QGLWidget const*)': slam2d_viewer.cpp:(.text+0x26b): undefined reference toQGLViewer::QGLViewer(QWidget, QGLWidget const, QFlags)' collect2: error: ld returned 1 exit status

I have successfully installed all the required dependencies listed in README, what else is missing? How can I solve the problem?

RainerKuemmerle commented 5 months ago

I successfully tested building in an uptodate Ubuntu 20.04 container running on and64 architecture.

Below is the version of libqglviewer being used

$ apt-cache policy libqglviewer-dev-qt5
libqglviewer-dev-qt5:
  Installed: 2.6.3+dfsg2-6build1
  Candidate: 2.6.3+dfsg2-6build1
  Version table:
 *** 2.6.3+dfsg2-6build1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status