error compiling g2o about g2o_viewer
Hi everyone,
Recently, I have been studying g2o link:[https://github.com/RainerKuemmerle/g2o] , an open-source C++ framework for optimizing graph-based nonlinear error functions, I followed the README in the file g2o. When i cmake the file, it all went well, but when i make it, it failed, which is run on ubuntu 14.04 indigo. Obviouly, making g2o_viewer went wrong. The details are as follows:
ljw@ljw-K42JZ:~/the_third_party_package/g2o/build$ make
[ 2%] Built target freeglut_minimal
[ 3%] Built target opengl_helper
[ 8%] Built target stuff
[ 23%] Built target core
[ 24%] Built target g2o_cli_library
[ 25%] Built target g2o_cli_application
[ 33%] Built target types_slam3d
[ 40%] Built target types_slam2d
[ 48%] Built target g2o_simulator_library
[ 48%] Built target g2o_simulator2d_application
[ 49%] Built target g2o_simulator3d_application
Linking CXX shared library ../../../../lib/libg2o_viewer.so
[ 57%] Built target viewer_library
Linking CXX executable ../../../../bin/g2o_viewer
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setPathKey(int, int)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setPlayPathStateKey(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::setSceneRadius(float)'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::addKeyFrameToPath(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::draw(bool, float) const'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::deletePath(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setMouseBinding(int, QGLViewer::MouseHandler, QGLViewer::MouseAction, bool)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setKeyFrameKey(int, int)'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::playPath(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::drawLight(unsigned int, float) const'
../../../../lib/libg2o_viewer.so: undefined reference to `qglviewer::Camera::resetPath(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setAddKeyFrameStateKey(int)'
../../../../lib/libg2o_viewer.so: undefined reference to `QGLViewer::setPlayKeyFramePathStateKey(int)'
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/g2o_viewer] Error 1
make[1]: *** [g2o/apps/g2o_viewer/CMakeFiles/g2o_viewer.dir/all] Error 2
make: *** [all] Error 2
I hope someone can help me solve the problem. Any suggestions are welcome. Thanks in advance.
jwlifly
Maybe a version conflict? I haven't got qglviewer installed at all, so g2o_viewer is skipped during compilation.
Do you have qglviewer installed at all?
i tried to install it, but it went wrong. I don't know why