Why cv_bridge uses opencv3.2 in ros melodic?
I have OpenCV 3.4 in my Ubuntu 18. I have installed ros melodic according to the website instructions. However, I have been getting the error:
/opt/ros/melodic/lib/image_view/image_view: error while loading shared libraries: libopencv_core.so.3.2: cannot open shared object file: No such file or directory
I found out that in the file: /ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
there is the following line hardcoded in opencv3.2:
set(libraries "cv_bridge;/usr/lib/x86_64-linux-gnu/libopencv_core.so.3.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.3.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0")
I would like to ask why is this hardcoded to opencv 3.2 and how can I set it to 3.4? I tried to change it but I can not rebuild it.
Update: I eventually installed OpenCV 3.2 and it worked properly.