Closed shreks7 closed 7 years ago
It sounds like your OpenCV build might have been compiled without CUDA? Check that wherever you installed OpenCV 3.3.0 (e.g. /usr/local/
), you have the core/cuda.hpp
file (e.g. /usr/local/include/opencv2/core/cuda.hpp
), or, alternately, check that the cvconfig.h
in either your build folder or your install folder has #define HAVE_CUDA
uncommented.
@madebyollin Thanks for the kind instructions!
I have the same error but I verified that I installed OpenCV with CUDA. I was previously getting this project to compile but I had to reflash my Tx2 and reinstall all the dependencies. I was originally getting issue #6 but after linking nvToolsExt the shared library still can't see any CUDA references.
[ 73%] Linking CXX executable rgbd_tum
../lib/libORB_SLAM2CUDA.so: undefined reference to `cv::cuda::createGaussianFilter(int, int, cv::Sizecv::cuda::copyMakeBorder(cv::_InputArray const&, cv::_OutputArray const&, int, int, int, int, int, cv::Scalar_<double>, cv::cuda::Stream&)' ../lib/libORB_SLAM2_CUDA.so: undefined reference to
cv::cuda::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size
@madebyollin I am getting the same error. Also I cross checked what you mention in your last comment, cuda.hpp is there inside core/cuda.hpp. cvconfig.h is also cross checked.
Doing the following has solved my problem: change target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${EIGEN3_LIBS} ${Pangolin_LIBRARIES} ${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so ${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so nvToolsExt ) to target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${EIGEN3_LIBS} ${Pangolin_LIBRARIES} ${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so ${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so nvToolsExt opencv_cudabgsegm opencv_cudaobjdetect opencv_cudastereo opencv_cudafeatures2d opencv_cudacodec opencv_cudaoptflow opencv_cudalegacy opencv_cudawarping opencv_cudaimgproc opencv_cudafilters )
Thank for the solution, I changed target_link_libraries
in main CMakeLists.txt and it worked.
More over, with following env, compile can success with no need to change target_link_libraries
:
I am getting this issue when building ORB_SLAM2
My config