OpenCV linking problems with ROS

后端 未结 4 674
礼貌的吻别
礼貌的吻别 2021-01-15 05:42

I\'m trying to compile this project (following the instructions given). When building it with rosmake, I get a bunch of undefined reference to cv::String:

4条回答
  •  独厮守ぢ
    2021-01-15 06:32

    I had this exact same problem - same error messages, same setup. I've managed to solve it, though I'm not exactly sure of the steps I did which actually contributed. As far as I can tell, it was due to a conflict of OpenCV versions - I think I had old versions of OpenCV cluttering my /usr/include and /usr/local. I uninstalled all OpenCV packages (including the ROS ones) and including my from-source install of OpenCV3 (also in /usr/local). Then I installed the ROS package vision_opencv, which seemed to install OpenCV 2.4.8 (incidentally the one recommended by LSD SLAM). Of course, this could be annoying if you need OpenCV3 for other things, but I now have that as a local install in my home directory (I couldn't figure out how to get ROS to link to this).

    I think this solved the problem, the only issue remaining was that I got error messages saying was not found. This was because the package install leaves it in (similar for all module include files), whereas the make install step of the from-source install copies them into the parent folder. To get around this I simply edited the #include in the only file in which it is used (lsd_slam_core/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp). That seemed to solve it!

    I hope this helps, I can give further details if needed.

提交回复
热议问题