At final Link library problem
speed8928 opened this issue · 1 comments
Hi
I tried to use opencv3 to build the system. I have success to build up DBoW. I have changed some source that related to SURF detector( that is pointer in opencv3). But, at target_link_libraries, it stops for some reasons I couldnt be able to figure out. If anyone know it?
My system is Ubutun 16.04. I used OpenCV 3.4.5 and PCL 1.8.
[100%] Linking CXX executable Kintinuous
libbackend.a(DBowInterfaceSurf.cpp.o): In function DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::getFlannStructure(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::FlannBasedMatcher&) const': DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE17getFlannStructureERKS1_IS3_SaIS3_EERN2cv17FlannBasedMatcherE[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE17getFlannStructureERKS1_IS3_SaIS3_EERN2cv17FlannBasedMatcherE]+0xc9): undefined reference to
DBoW2::FSurf64::toMat32F(std::vector<std::vector<float, std::allocator >, std::allocator<std::vector<float, std::allocator > > > const&, cv::Mat&)'
libbackend.a(DBowInterfaceSurf.cpp.o): In function DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::transform(std::vector<float, std::allocator<float> > const&, unsigned int&, double&, unsigned int*, int) const': DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji]+0xc6): undefined reference to
DBoW2::FSurf64::distance(std::vector<float, std::allocator > const&, std::vector<float, std::allocator > const&)'
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji]+0xf9): undefined reference to DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)' libbackend.a(DBowInterfaceSurf.cpp.o): In function
DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator >, DBoW2::FSurf64>::isGeometricallyConsistent_Flann(unsigned int, std::vector<cv::KeyPoint, std::allocatorcv::KeyPoint > const&, std::vector<std::vector<float, std::allocator >, std::allocator<std::vector<float, std::allocator > > > const&, cv::FlannBasedMatcher&) const':
DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE31isGeometricallyConsistent_FlannEjRKS1_IN2cv8KeyPointESaIS8_EERKS1_IS3_SaIS3_EERNS7_17FlannBasedMatcherE[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE31isGeometricallyConsistent_FlannEjRKS1_IN2cv8KeyPointESaIS8_EERKS1_IS3_SaIS3_EERNS7_17FlannBasedMatcherE]+0x12f): undefined reference to DBoW2::FSurf64::toMat32F(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::Mat&)' libbackend.a(DBowInterfaceSurf.cpp.o): In function
DBoW2::TemplatedVocabulary<std::vector<float, std::allocator >, DBoW2::FSurf64>::save(cv::FileStorage&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const':
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4saveERN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4saveERN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c6): undefined reference to DBoW2::FSurf64::toString[abi:cxx11](std::vector<float, std::allocator<float> > const&)' libbackend.a(DBowInterfaceSurf.cpp.o): In function
DBoW2::TemplatedVocabulary<std::vector<float, std::allocator >, DBoW2::FSurf64>::load(cv::FileStorage const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4loadERKN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4loadERKN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x23c): undefined reference to DBoW2::FSurf64::fromString(std::vector<float, std::allocator<float> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' libbackend.a(DBowInterfaceSurf.cpp.o): In function
DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator >, DBoW2::FSurf64>::getMatches_neighratio(std::vector<std::vector<float, std::allocator >, std::allocator<std::vector<float, std::allocator > > > const&, std::vector<unsigned int, std::allocator > const&, std::vector<std::vector<float, std::allocator >, std::allocator<std::vector<float, std::allocator > > > const&, std::vector<unsigned int, std::allocator > const&, std::vector<unsigned int, std::allocator >&, std::vector<unsigned int, std::allocator >&) const':
DBowInterfaceSurf.cpp:(.text.ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF[ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF]+0x150): undefined reference to DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)' DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_]+0x312): undefined reference to
DBoW2::FSurf64::distance(std::vector<float, std::allocator > const&, std::vector<float, std::allocator > const&)'
libbackend.a(DBowInterfaceSurf.cpp.o): In function DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::initiateClustersKMpp(std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >&) const': DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE]+0x261): undefined reference to
DBoW2::FSurf64::distance(std::vector<float, std::allocator > const&, std::vector<float, std::allocator > const&)'
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE]+0x2cb): undefined reference to DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)' libbackend.a(DBowInterfaceSurf.cpp.o): In function
DBoW2::TemplatedVocabulary<std::vector<float, std::allocator >, DBoW2::FSurf64>::HKmeansStep(unsigned int, std::vector<std::vector<float, std::allocator > const*, std::allocator<std::vector<float, std::allocator > const*> > const&, int)':
DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x29a): undefined reference to DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)' libbackend.a(DBowInterfaceSurf.cpp.o):DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x2dd): more undefined references to
DBoW2::FSurf64::distance(std::vector<float, std::allocator > const&, std::vector<float, std::allocator > const&)' follow
libbackend.a(DBowInterfaceSurf.cpp.o): In function DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::HKmeansStep(unsigned int, std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, int)': DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x4f1): undefined reference to
DBoW2::FSurf64::meanValue(std::vector<std::vector<float, std::allocator > const*, std::allocator<std::vector<float, std::allocator > const*> > const&, std::vector<float, std::allocator >&)'
collect2: error: ld returned 1 exit status
CMakeFiles/Kintinuous.dir/build.make:449: recipe for target 'Kintinuous' failed
make[2]: *** [Kintinuous] Error 1
CMakeFiles/Makefile2:180: recipe for target 'CMakeFiles/Kintinuous.dir/all' failed
make[1]: *** [CMakeFiles/Kintinuous.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I solved it by reinstall opencv 2.4.9 form https://github.com/lakehanne/opencv-2.4.9 and specify all dependencies with this opencv and follow the installation guide with this page https://github.com/HTLife/Kintinuous-installation-guide/blob/master/Kintinuous-installation-guide-16.04.md