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

Compilation errors #8

Open
hafidh561 opened this issue May 13, 2022 · 4 comments
Open

Compilation errors #8

hafidh561 opened this issue May 13, 2022 · 4 comments

Comments

@hafidh561
Copy link

hafidh561 commented May 13, 2022

Hello, when I build using ubuntu 20.04, ROS2 Foxy, I get errors like this. I installed all required dependencies before like in tutorials. Thanks you

--- stderr: ros2_orbslam
/usr/bin/ld: CMakeFiles/stereo.dir/src/stereo/stereo-slam-node.cpp.o: undefined reference to symbol '_ZN2cv23initUndistortRectifyMapERKNS_11_InputArrayES2_S2_S2_NS_5Size_IiEEiRKNS_12_OutputArrayES7_'
/usr/bin/ld: /usr/local/lib/libopencv_calib3d.so.405: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/stereo.dir/build.make:217: stereo] Error 1
make[1]: *** [CMakeFiles/Makefile2:101: CMakeFiles/stereo.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
---
Failed   <<< ros2_orbslam [2.13s, exited with code 2]
Aborted  <<< opencv_tests [2.74s]
@bfan1256
Copy link

Also getting this error, happening for us on 20.04 with the ros:foxy base image and OpenCV 4.2

@EndlessLoops
Copy link

Test Background: ubuntu 2204 + ros humble + opencv 4.5.4
Add the opencv lib in the CMakeLists.txt

find_package(OpenCV 4.0 QUIET)
... 
ament_target_dependencies(stereo rclcpp sensor_msgs cv_bridge message_filters ORB_SLAM2 Pangolin OpenCV)

@alsora
Copy link
Owner

alsora commented Mar 9, 2023

The repository was developed for Ubuntu 18.04 and ROS 2 Foxy.
Any other configuration will likely require some updates and changes.

The error indicates that OpenCV is not being correctly linked, in particular the libopencv_calib3d.so library.

@ccwss007
Copy link

Add the following line to the CMakeLists.txt file under orbslam3 in the workspace:
(Preferably, add another find_package(OpenCV 4.x QUIET) above it)
Then add:
target_link_libraries(stereo-inertial ${OpenCV_LIBS})
Add this line between add_executable and ament_target_dependencies.

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

5 participants