rubengooj / stvo-pl

Stereo Visual Odometry by combining point and line segment features
GNU General Public License v3.0
222 stars 96 forks source link

error when make #16

Open shield218 opened 5 years ago

shield218 commented 5 years ago

encoutered an error when make, my OS version is ubuntu18.04 with kernel 4.18, opencv version is 3.3.1 with contrib, mrpt is the version recommended in this repo, eigen 3.3.4, boost 1.65.1, yaml 0.5.2, tried all major versions from gcc4.8 to gcc7, seems that error encountered during linking.

PS: I've already added the following 2 lines in src/stereoFrameHandler.cpp in order to solve the error "random_device undefined" #include <iostream> using namespace std

my command(with gcc-7.4.0): make d=VS

error info:

[100%] Linking CXX executable imagesStVO ../lib/libstvo.so: undefined reference tocv::ximgproc::createFastLineDetector(int, float, double, double, int, bool)' ../lib/libstvo.so: undefined reference to mrpt::utils::CConfigFile::CConfigFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' ../lib/libstvo.so: undefined reference tomrpt::utils::CConfigFileBase::read_double(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, double, bool) const' ../lib/libstvo.so: undefined reference to mrpt::gui::CDisplayWindow3D::addTextMessage(double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mrpt::utils::TColorf const&, unsigned long, mrpt::opengl::TOpenGLFont)' ../lib/libstvo.so: undefined reference tomrpt::utils::CImage::loadFromFile(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)' ../lib/libstvo.so: undefined reference to `mrpt::opengl::COpenGLScene::insert(mrpt::opengl::CRenderizablePtr const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' ../lib/libstvo.so: undefined reference to mrpt::utils::CConfigFileBase::read_bool(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) const' ../lib/libstvo.so: undefined reference tomrpt::opengl::COpenGLScene::createViewport(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' ../lib/libstvo.so: undefined reference to `mrpt::gui::CDisplayWindow3D::CDisplayWindow3D(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned int, unsigned int)' collect2: error: ld returned 1 exit status CMakeFiles/imagesStVO.dir/build.make:122: recipe for target 'imagesStVO' failed make[2]: [imagesStVO] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/imagesStVO.dir/all' failed make[1]: [CMakeFiles/imagesStVO.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 `

SEULiulh commented 1 year ago

I occured the similiar question this day:

../lib/libstvo.so:对‘cv::ximgproc::createFastLineDetector(int, float, double, double, int, bool)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/imagesStVO.dir/build.make:123: recipe for target 'imagesStVO' failed
make[2]: *** [imagesStVO] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/imagesStVO.dir/all' failed
make[1]: *** [CMakeFiles/imagesStVO.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

And I found the reason is that the opencv_contrib-3.4.0 haven't been rightly installed in my computer. I hope this message would be helpful.