Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined Reference to cv::CUDA when library is getting linked #14

Closed
connorsoohoo opened this issue Jul 26, 2018 · 4 comments
Closed

Comments

@connorsoohoo
Copy link

connorsoohoo commented Jul 26, 2018

I have the same error as #7 but I verified that I installed OpenCV with CUDA. I was previously getting this project to compile before I reflashed my Tx2 but I had to reflash my Tx2 and reinstall all the dependencies. I was originally getting issue #6 but after linking nvToolsExt to my /usr/lib folder I still can't see any CUDA references.

@connorsoohoo
Copy link
Author

I had to reflash my Tx2 and reinstall to link the libraries properly.

@cbachhuber
Copy link

Also, as written in Raul Mur-Artal's instructions, ORB-SLAM only works with OpenCV 3.1.0 out of the box. You can check your OpenCV version in /usr/local/include/opencv2/core/version.hpp, where for example

#define CV_VERSION_MAJOR    3
#define CV_VERSION_MINOR    4
#define CV_VERSION_REVISION 1

stands for OpenCV 3.4.1. ORB-SLAM also works fine with OpenCV 3.4.1, you just have to replace the line

find_package(OpenCV 3.1.0 REQUIRED)

of CMakeLists.txt by

find_package(OpenCV 3.0 QUIET)
if(NOT OpenCV_FOUND)
   find_package(OpenCV 2.4.3 QUIET)
   if(NOT OpenCV_FOUND)
      message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
   endif()
endif()

@connorsoohoo
Copy link
Author

Yea I think I came across that solution at some point, and it works. I think the issue was that I had installed ROS' version of OpenCV and ORB SLAM was just linking to that version of OpenCV first. By just changing the specified version of OpenCV version to be 3.4.1 (or the version that you directly installed), I was able to solve the problem without having to reflash and reinstall.

@cbachhuber
Copy link

cbachhuber commented Sep 13, 2018

Right! Later I also saw the conflict with the ROS version, so I ended up replacing the above mentioned line by

find_package(OpenCV REQUIRED
    NO_MODULE
    PATHS /usr/local
NO_DEFAULT_PATH)

as described in the ROS answers. This method avoids that cmake is searching for OpenCV in the ROS directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants