VladimirYugay / KinectFusion

3D geometry estimation from RGB-D data using Kinect Fusion approach
52 stars 9 forks source link

Fixing the compilation error (gnu/intel); using stable eigen release #7

Closed quepas closed 2 years ago

quepas commented 2 years ago

This pull request fixes a compilation error occurring on GCC 9.3.0 and Intel 2021.4.0.20210910. The problem has been encountered by others in #6. Also, I have added in the README a recommendation to use a stable eigen release. Both my compilers are not able to compile the latest upstream eigen (weird but true! :)).

Error message on GNU:

[ 62%] Building CXX object CMakeFiles/kinect_fusion.dir/src/main.cpp.o
/home/KinectFusion/src/main.cpp: In function ‘int main()’:
/home/KinectFusion/src/main.cpp:112:50: error: cannot bind non-const lvalue reference of type ‘std::__detail::_Node_iterator<std::pair<const Eigen::Matrix<int, 3, 1>, bool>, false, true>&’ to an rvalue of type ‘std::unordered_map<Eigen::Matrix<int, 3, 1>, bool, matrix_hash<Eigen::Matrix<int, 3, 1> > >::iterator’ {aka ‘std::__detail::_Node_iterator<std::pair<const Eigen::Matrix<int, 3, 1>, bool>, false, true>’}
  112 |               for (auto &it = visitedVoxels.begin(); it != visitedVoxels.end(); it++)
      |                               ~~~~~~~~~~~~~~~~~~~^~

Thanks for the great work!

VladimirYugay commented 2 years ago

Thanks!