SpectacularAI / HybVIO

HybVIO visual-inertial odometry and SLAM system

Home Page:https://arxiv.org/abs/2106.11857

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make error

FlyCole opened this issue · comments

Hi, I'm also stuck here, the same as closed issure #11 (on Ubuntu18.04). I tried to rm -rf target and using clang-10.0 but still doesn't work. May I ask is there any other way to solve this?

Please provide a reproducible example:

  • What exact commands did you run?
  • What exact error apppered?

Sorry, when I run make -j6 here,

mkdir target
cd target
cmake -DBUILD_VISUALIZATIONS=ON -DUSE_SLAM=ON ..
# or if not using clang by default:
# CC=clang CXX=clang++ cmake ..
make -j6

I got this error:

/home/ryf/slam/HybVIO/src/slam/orb_extractor.cpp: In member function ‘virtual void slam::{anonymous}::OrbExtractorImplementation::detectAndExtract(tracker::Image&, const tracker::Camera&, const std::vector<tracker::Feature>&, slam::KeyPointVector&, std::vector<int>&)’:
/home/ryf/slam/HybVIO/src/slam/orb_extractor.cpp:110:18: warning: missing initializer for member ‘slam::KeyPoint::bearing’ [-Wmissing-field-initializers]
                 });
                  ^
/home/ryf/slam/HybVIO/src/slam/orb_extractor.cpp:110:18: warning: missing initializer for member ‘slam::KeyPoint::descriptor’ [-Wmissing-field-initializers]
/home/ryf/slam/HybVIO/src/slam/orb_extractor.cpp:161:18: error: no matching function for call to ‘std::vector<slam::KeyPoint, Eigen::aligned_allocator<slam::KeyPoint> >::push_back(<brace-enclosed initializer list>)’
                 });
                  ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/ryf/slam/HybVIO/src/slam/static_settings.hpp:4,
                 from /home/ryf/slam/HybVIO/src/slam/orb_extractor.hpp:4,
                 from /home/ryf/slam/HybVIO/src/slam/orb_extractor.cpp:40:
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = slam::KeyPoint; _Alloc = Eigen::aligned_allocator<slam::KeyPoint>; std::vector<_Tp, _Alloc>::value_type = slam::KeyPoint]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type& {aka const slam::KeyPoint&}’
/usr/include/c++/7/bits/stl_vector.h:953:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = slam::KeyPoint; _Alloc = Eigen::aligned_allocator<slam::KeyPoint>; std::vector<_Tp, _Alloc>::value_type = slam::KeyPoint]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<slam::KeyPoint, Eigen::aligned_allocator<slam::KeyPoint> >::value_type&& {aka slam::KeyPoint&&}’
src/slam/CMakeFiles/slam.dir/build.make:470: recipe for target 'src/slam/CMakeFiles/slam.dir/orb_extractor.cpp.o' failed
make[2]: *** [src/slam/CMakeFiles/slam.dir/orb_extractor.cpp.o] Error 1
CMakeFiles/Makefile2:340: recipe for target 'src/slam/CMakeFiles/slam.dir/all' failed
make[1]: *** [src/slam/CMakeFiles/slam.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

Referencing error #11 , I have tried rm -rf target and using clang-10, but still doesn't work.

It may be that you are not really using clang-10. Note that if you just apt install clang-10, this does not guarantee that you are actually using it in Ubuntu. Try clang --version to verify. Also try rebuilding mobile-cv-suite after changing the compiler version.

Thanks for your advice and I checked the clang version to be 10.0. I have also tried rebuilding mobile-cv-suite but still doesn't work. I would change a computer to rebuild. Thanks.

I also think the errors look like an unsupported compiler is being used. Can you check the file target/CMakeCache.txt contains this kind of line: CMAKE_CXX_COMPILER:STRING=/usr/bin/clang++, and not something ending in gcc++.

To clarify, if echo $CXX doesn't say /usr/bin/clang++, then you need to set the compiler to clang before compiling, like this:

CC=clang CXX=clang++ cmake ..
make -j6