Open haythemsgh opened 8 years ago
@haythemsgh I don't have this problem but I did meet other problems during installation. I solved them by adding cmake -D OpenCV_DIR=/usr/local/opencv-2.4.13/release/ ..
to the build.sh
file (http://stackoverflow.com/questions/18327197/opencv-is-considered-to-be-not-found). I am not sure if this helps but worth a try.
Another solution to make it work with OpenCV 3 is to delete the 2.4 dependency in this line: https://github.com/raulmur/ORB_SLAM2/blob/master/CMakeLists.txt#L31
I tried it in Ubuntu 16.04 with ROS Kinetic (which includes OpenCV 3) and it worked without problems.
@drinking-tea Thank you for your response, but the thing is that I want to build ORBslam2 with ROS Kinetic so I want to build it with opencv 3.1. @mmattamala I deleted the dependency of 2.4 and changed with find_package(OpenCV 3.1.0 REQUIRED) I also added this line in Line 2 set(OpenCV_DIR=/opt/ros/kinetic/share/OpenCV-3.1.0-dev) ("That's the directory of opencvconfigversion.cmake") but when I run make -j I get this new error.
In file included from /usr/include/eigen3/Eigen/Core:297:0,
from /home/haythem/Pangolin/include/pangolin/gl/gl.h:39,
from /home/haythem/Pangolin/include/pangolin/pangolin.h:33,
from /home/haythem/ORB_SLAM2/include/MapDrawer.h:27,
from /home/haythem/ORB_SLAM2/include/Viewer.h:26,
from /home/haythem/ORB_SLAM2/include/Tracking.h:28,
from /home/haythem/ORB_SLAM2/include/LocalMapping.h:27,
from /home/haythem/ORB_SLAM2/include/LoopClosing.h:25,
from /home/haythem/ORB_SLAM2/include/Optimizer.h:27,
from /home/haythem/ORB_SLAM2/src/Optimizer.cc:21:
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h: In instantiation of ‘void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Matrix<int, -1, 1>; Src = Eigen::Matrix<long int, -1, 1, 0, -1, 1>; Func = Eigen::internal::assign_op
^
/usr/include/eigen3/Eigen/src/Core/util/XprHelper.h:707:3: note: in expansion of macro ‘EIGEN_STATIC_ASSERT’
EIGEN_STATIC_ASSERT((internal::functor_is_product_like
I've tried another solution to change SparseMatrix::Index to int in ORB_SLAM2/Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h but nothing worked.
I've tried another solution to change SparseMatrix::Index to int in ORB_SLAM2/Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h but nothing worked.
Try doing the opposite. I fixed it by changing typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
to typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::StorageIndex> PermutationMatrix;
@cranil Thank you very much .Thanks to your solution I succeeded to build orbslam2 in ubuntu 16.04 without errors.
The solution of @drinking-tea is a way to solve this! The true problem of this error is link to the wrong Eigen lib directory. Maybe your system has installed more than one eigen with another version before? so that the newer version doesn't have
typeddef ... SparseMatrix::Index...
You can edit CMakeLists.txt to set EIGEN3_INCLUDE_DIR
to direct to the right dir.
ex: set(EIGEN3_INCLUDE_DIR /usr/local/include/eigen3)
I also have similar issue I am attaching a file which contains my bash output. Can someone suggest a fix?
I stuck on this error any idea on this error:
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_euroc.dir/build.make:165: recipe for target '../Examples/Monocular/mono_euroc' failed make[2]: *** [../Examples/Monocular/mono_euroc] Error 1 CMakeFiles/Makefile2:294: recipe for target 'CMakeFiles/mono_euroc.dir/all' failed make[1]: *** [CMakeFiles/mono_euroc.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/mono_tum.dir/build.make:165: recipe for target '../Examples/Monocular/mono_tum' failed
make[2]: [../Examples/Monocular/mono_tum] Error 1
CMakeFiles/Makefile2:220: recipe for target 'CMakeFiles/mono_tum.dir/all' failed
make[1]: [CMakeFiles/mono_tum.dir/all] Error 2
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/rgbd_tum.dir/build.make:165: recipe for target '../Examples/RGB-D/rgbd_tum' failed make[2]: *** [../Examples/RGB-D/rgbd_tum] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/rgbd_tum.dir/all' failed make[1]: *** [CMakeFiles/rgbd_tum.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/mono_kitti.dir/build.make:165: recipe for target '../Examples/Monocular/mono_kitti' failed
make[2]: [../Examples/Monocular/mono_kitti] Error 1
CMakeFiles/Makefile2:257: recipe for target 'CMakeFiles/mono_kitti.dir/all' failed
make[1]: [CMakeFiles/mono_kitti.dir/all] Error 2
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to _glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/stereo_kitti.dir/build.make:165: recipe for target '../Examples/Stereo/stereo_kitti' failed make[2]: *** [../Examples/Stereo/stereo_kitti] Error 1 CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/stereo_kitti.dir/all' failed make[1]: *** [CMakeFiles/stereo_kitti.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current'
collect2: error: ld returned 1 exit status
CMakeFiles/stereo_euroc.dir/build.make:165: recipe for target '../Examples/Stereo/stereo_euroc' failed
make[2]: [../Examples/Stereo/stereo_euroc] Error 1
CMakeFiles/Makefile2:183: recipe for target 'CMakeFiles/stereo_euroc.dir/all' failed
make[1]: [CMakeFiles/stereo_euroc.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I stuck on this error any idea on this error:
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_euroc.dir/build.make:165: recipe for target '../Examples/Monocular/mono_euroc' failed make[2]: *** [../Examples/Monocular/mono_euroc] Error 1 CMakeFiles/Makefile2:294: recipe for target 'CMakeFiles/mono_euroc.dir/all' failed make[1]: *** [CMakeFiles/mono_euroc.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_tum.dir/build.make:165: recipe for target '../Examples/Monocular/mono_tum' failed make[2]: [../Examples/Monocular/mono_tum] Error 1 CMakeFiles/Makefile2:220: recipe for target 'CMakeFiles/mono_tum.dir/all' failed make[1]: [CMakeFiles/mono_tum.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/rgbd_tum.dir/build.make:165: recipe for target '../Examples/RGB-D/rgbd_tum' failed make[2]: *** [../Examples/RGB-D/rgbd_tum] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/rgbd_tum.dir/all' failed make[1]: *** [CMakeFiles/rgbd_tum.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/mono_kitti.dir/build.make:165: recipe for target '../Examples/Monocular/mono_kitti' failed make[2]: [../Examples/Monocular/mono_kitti] Error 1 CMakeFiles/Makefile2:257: recipe for target 'CMakeFiles/mono_kitti.dir/all' failed make[1]: [CMakeFiles/mono_kitti.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/stereo_kitti.dir/build.make:165: recipe for target '../Examples/Stereo/stereo_kitti' failed make[2]: *** [../Examples/Stereo/stereo_kitti] Error 1 CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/stereo_kitti.dir/all' failed make[1]: *** [CMakeFiles/stereo_kitti.dir/all] Error 2 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libOpenGL.so: undefined reference to
_glapi_tls_Current' collect2: error: ld returned 1 exit status CMakeFiles/stereo_euroc.dir/build.make:165: recipe for target '../Examples/Stereo/stereo_euroc' failed make[2]: [../Examples/Stereo/stereo_euroc] Error 1 CMakeFiles/Makefile2:183: recipe for target 'CMakeFiles/stereo_euroc.dir/all' failed make[1]: [CMakeFiles/stereo_euroc.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
I got a very similar error with TUM Dataset
Hi, I want to install Orbslam2 on ubuntu 16.04. I've installed all the necessary dependencies. At first i've got error to build the third library Dbow2 because i've installed opencv 3.1 then i've fixed by installing opencv 2.4.11 and modified the cmakelists by replacing find_package(opencv required) by opencv 2.4.11 and it worked. But when it comes to building orbslam it stopped at 81% and show me this message.