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

GPU version of opencv catkin_make compile error in ROS melodic #110

Closed
Lygggggg opened this issue Mar 19, 2021 · 3 comments
Closed

GPU version of opencv catkin_make compile error in ROS melodic #110

Lygggggg opened this issue Mar 19, 2021 · 3 comments

Comments

@Lygggggg
Copy link

Main ERROR:/usr/local/lib/libopencv_cudafeatures2d.so.3.2.0: undefined reference to `cv::cuda::...'

when I try to compile the package with GPU version of OpenCV,i occured the error,can you help me?
My configuration is Ubuntu18.04
ROS melodic
Source compile OpenCV3.2.0 with GPU,cuda10.2

[ 0%] Built target sensor_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target sensor_msgs_generate_messages_cpp
[ 0%] Built target sensor_msgs_generate_messages_nodejs
[ 0%] Built target sensor_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target sensor_msgs_generate_messages_py
[ 3%] Built target kinect2_registration
[ 3%] Built target _find_object_2d_generate_messages_check_deps_ObjectsStamped
[ 3%] Built target _find_object_2d_generate_messages_check_deps_DetectionInfo
[ 5%] Built target find_object_2d_generate_messages_nodejs
[ 7%] Built target find_object_2d_generate_messages_cpp
[ 10%] Built target kinect2_bridge
[ 13%] Built target find_object_2d_generate_messages_py
[ 15%] Built target find_object_2d_generate_messages_lisp
[ 19%] Built target find_object_2d_generate_messages_eus
[ 21%] Built target kinect2_calibration
[ 23%] Built target kinect2_bridge_nodelet
[ 23%] Built target find_object_2d_generate_messages
[ 25%] Built target kinect2_viewer
[ 30%] Built target tf_example
[ 30%] Built target print_objects_detected
[ 97%] Built target find_object
[ 98%] Linking CXX executable /home/lni/Ros_ws/catkin_ws/devel/lib/find_object_2d/find_object_2d
/usr/local/lib/libopencv_cudafeatures2d.so.3.2.0: undefined reference to cv::cuda::BufferPool::getBuffer(int, int, int)' /usr/local/lib/libopencv_cudafeatures2d.so.3.2.0: undefined reference to cv::cuda::device::ThrustAllocator::getAllocator()'
/usr/local/lib/libopencv_cudafeatures2d.so.3.2.0: undefined reference to cv::cuda::StreamAccessor::getStream(cv::cuda::Stream const&)' /usr/local/lib/libopencv_cudafeatures2d.so.3.2.0: undefined reference to cv::cuda::BufferPool::BufferPool(cv::cuda::Stream&)'
collect2: error: ld returned 1 exit status
find-object-0.6.3/src/CMakeFiles/find_object_2d.dir/build.make:166: recipe for target '/home/lni/Ros_ws/catkin_ws/devel/lib/find_object_2d/find_object_2d' failed
make[2]: *** [/home/lni/Ros_ws/catkin_ws/devel/lib/find_object_2d/find_object_2d] Error 1
CMakeFiles/Makefile2:2531: recipe for target 'find-object-0.6.3/src/CMakeFiles/find_object_2d.dir/all' failed
make[1]: *** [find-object-0.6.3/src/CMakeFiles/find_object_2d.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j16 -l16" failed

@DapengLan
Copy link

I have the same issue. Did you solve it already?

@Lygggggg
Copy link
Author

Lygggggg commented Apr 4, 2021

I have the same issue. Did you solve it already?

Yes, I reinstalled OpenCv with its version 4.3.0.you can try it.

@matlabbe matlabbe closed this as completed May 4, 2021
@matlabbe
Copy link
Member

Small update, it could also be that multiple versions of opencv libraries are added to linker and not in right order to resolve the functions. See introlab/rtabmap#1330 (comment) for example.

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

3 participants