JakobEngel / dso_ros

ROS wrapper for dso
GNU General Public License v3.0
320 stars 210 forks source link

Issue compiling dso_ros #8

Closed sevbest closed 6 years ago

sevbest commented 7 years ago

My dso lib is compiled with opencv as per the make command: sev@sev-VirtualBox:~/code/dso/build$ cmake .. -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- thread -- chrono -- date_time -- atomic --- found PANGOLIN, compiling dso_pangolin library. --- found OpenCV, compiling dso_opencv library. --- found ziplib (1.1.1), compiling with zip capability. --- compiling dso_dataset. -- Configuring done -- Generating done -- Build files have been written to: /home/sev/code/dso/build

however rosmake is complaining about missing entrypoints in the dso lib:

[ 50%] Linking CXX executable bin/dso_live /home/sev/code/dso/build/lib/libdso.a(ImageDisplay_OpenCV.cpp.o): In function dso::IOWrap::displayImage(char const*, cv::Mat const&, bool)': /home/sev/code/dso/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp:58: undefined reference tocv::namedWindow(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)' /home/sev/code/dso/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp:59: undefined reference to `cv::resizeWindow(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)' ...

any idea what is going wrong here?

JakobEngel commented 7 years ago

I believe that means the OpenCV libs are not linked correctly by rosmake (specifically the one that contains cv::namedWindow). I am however not sure how to tell ROS to properly link the openCV libs - the issue may also come from different OpenCV versions being linked / included by dso's cmake and rosmake - or different compiler versions (gcc 4.X vs 5.X) being used to build them.

archenroot commented 7 years ago

@sevbest - have you fixed this?

burknator commented 6 years ago

Did anyone find a fix for this?

NikolausDemmel commented 6 years ago

As Jakob wrote, mismatching compiler and/or opencv versions is the likely cause.

Can you provide some basic info: Which code version (both dso and dso_ros), what OS, which ROS version, which complier, and what are the outputs of cmake for dso and robuild for dso_ros.

Have you tried with catkin instead of rosbuild? There is a catkin branch in dso_ros.

burknator commented 6 years ago

Thanks for the quick response! Oversaw that he wrote about different OpenCV versions. In fact, ROS seems to install it's own OpenCV 3.2, but libopencv-dev is version 2.4, which I used to compile dso with.

I think this is it, I will try a few things and get back to you.

burknator commented 6 years ago

Yep, that's it. sudo apt purge libopencv-dev and then compiled dso again worked. It recognized the OpenCV package from ROS itself (ros-kinetic-opencv). Also used the catkin branch and catkin_make.

NikolausDemmel commented 6 years ago

Nice. Thanks for reporting back. I'll close this issue then.