-
Notifications
You must be signed in to change notification settings - Fork 41
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
Linking error to OpenCV #4
Comments
I haven't seen this, but could you make another minimal testing folder for OpenCV? Generate a cv::Mat and print, or imread an image and visualize it out. See how you properly configure your OpenCV libraries in your CMakeLists.txt, and replace all OpenCV configurations under this repository with that one. Some tips that may help:
|
Another suggestion could be that, in src/visual_odometry/CMakeLists.txt, at both line 145 and 152, add |
I get this problem "tried to advertise a service that is already advertised in this node" when I run this program. Have you faced this issue? Looking forward to your reply. |
@wwq985 This is really another problem. Could you please open another issue? In that new issue, please attach some more information, eg. which service is complaining, which command you have input into each terminal, and if there's any other ROS program/node running. |
Thanks. |
Adding the path to opencv in include_directories solved the issue. Thanks |
@kloukiniotisandreas This I think means that your opencv hasn't been properly configured with CMake. |
I also encountered the same problem,I am using ros melodic and Ubuntu 18.04。 In vloam_main/CMakeFiles,I add the path to opencv But still not resolved,Looking forward to your reply. |
The main problem is that there're undefined references of OpenCV. Did you manage to compile any code using OpenCV with CMake? If so, please feel free to adapt the cmakelists under this repo. And maybe share your solution here. https://github.com/YukunXia/VLOAM-CMU-16833/blob/master/src/vloam_main/CMakeLists.txt#L180-L182 The |
I solved this problem according to your suggestion,thank you very much. |
Cool. I'll close this issue again. |
I am getting a linking error to OpenCV in catkin_make. I am using ros melodic and Ubuntu 18.04.5. Have you faced this issue?
[ 92%] Built target laser_mapping
[ 94%] Building CXX object VLOAM-CMU-16833/src/lidar_odometry_mapping/CMakeFiles/lidar_odometry_mapping.dir/src/lidar_odometry_mapping.cpp.o
[ 96%] Linking CXX shared library /home/beastv2/catkin_ws/devel/lib/liblidar_odometry_mapping.so
[ 96%] Built target lidar_odometry_mapping
[ 98%] Building CXX object VLOAM-CMU-16833/src/vloam_main/CMakeFiles/vloam_main_node.dir/src/vloam_main_node.cpp.o
[100%] Linking CXX executable /home/beastv2/catkin_ws/devel/lib/vloam_main/vloam_main_node
/home/beastv2/catkin_ws/devel/lib/libimage_util.so: undefined reference to
cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)' /home/beastv2/catkin_ws/devel/lib/libimage_util.so: undefined reference to
cv::namedWindow(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'/home/beastv2/catkin_ws/devel/lib/libimage_util.so: undefined reference to
cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, int, cv::TermCriteria, int, double)' /home/beastv2/catkin_ws/devel/lib/libimage_util.so: undefined reference to
cv::waitKey(int)'/home/beastv2/catkin_ws/devel/lib/libpoint_cloud_util.so: undefined reference to `cv::setMouseCallback(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, void ()(int, int, int, int, void), void*)'
collect2: error: ld returned 1 exit status
VLOAM-CMU-16833/src/vloam_main/CMakeFiles/vloam_main_node.dir/build.make:975: recipe for target '/home/beastv2/catkin_ws/devel/lib/vloam_main/vloam_main_node' failed
make[2]: *** [/home/beastv2/catkin_ws/devel/lib/vloam_main/vloam_main_node] Error 1
CMakeFiles/Makefile2:2542: recipe for target 'VLOAM-CMU-16833/src/vloam_main/CMakeFiles/vloam_main_node.dir/all' failed
make[1]: *** [VLOAM-CMU-16833/src/vloam_main/CMakeFiles/vloam_main_node.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
The text was updated successfully, but these errors were encountered: