Undefined reference to boost after source compilation of vision_opencv !!

asked 2020-07-10 16:11:51 -0600

JeyP4 gravatar image

updated 2020-07-11 06:22:05 -0600

Hello

My aim is to link image-transport-plugins with source build opencv-3.4.9.

My proceedings are:

sudo apt purge ros-kinetic-cv-bridge \
ros-kinetic-image-geometry \
ros-kinetic-image-transport-plugins \
ros-kinetic-image-transport \
ros-kinetic-image-common \
ros-kinetic-vision-opencv

// In a new catkin_ws

git clone https://github.com/ros-perception/vision_opencv                  {git checkout kinetic}
git clone https://github.com/ros-perception/image_transport_plugins {git checkout indigo-devel}
git clone https://github.com/ros-perception/image_common.git          {git checkout hydro-devel}

catkin_make -DCMAKE_BUILD_TYPE=Release {without specifying new OpenCV_DIR, so it is finding default 3.3.1-dev (No problem, later on I will specify)}

Problem is when I am trying to use cv_bridge in my pkgs, it throws compilation error.

/home/jai/catkin_ws_ROS/devel/lib/libcv_bridge.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
/home/jai/catkin_ws_ROS/devel/lib/libcv_bridge.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/jai/catkin_ws_ROS/devel/lib/imagepub/imagepub] Error 1
make[1]: *** [imagepub/CMakeFiles/imagepub.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

The above error is result of the below code.

cv_bridge::CvImage(std_msgs::Header(), "bgr8", Mat).toImageMsg();

My system is ubuntu16.04 with Kinetic.

I tried

sudo apt install libboost1.58-all-dev libboost1.58-dev  {but no luck}
gcc --version
gcc (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026

How to overcome this error?

edit retag flag offensive close merge delete