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

image_view : error while loading shared libraries: libopencv_core3.so.3.2: cannot open shared object file: No such file or directory #104

Open
archenroot opened this issue Jun 14, 2017 · 23 comments

Comments

@archenroot
Copy link

As the message says:

zangetsu@ares ~/proj/neural-networks/3d-voxel-reconstruction $ rosrun image_view image_view image:=/Mono/Frame _autosize:=true
/opt/ros/lunar/lib/image_view/image_view: error while loading shared libraries: libopencv_core3.so.3.2: cannot open shared object file: No such file or directory

I have ros-lunar/opencv cv_bridge as well, the issue is that image_view is linked against /libopencv_core3.so.3.2.0 library:

/usr/bin/cmake -E cmake_link_script CMakeFiles/image_view.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -march=broadwell -O2 -pipe -std=c++11 -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -shared -Wl,-soname,libimage_view.so -o devel/lib/libimage_view.so CMakeFiles/image_view.dir/src/nodelets/image_nodelet.cpp.o CMakeFiles/image_view.dir/src/nodelets/disparity_nodelet.cpp.o CMakeFiles/image_view.dir/src/nodelets/window_thread.cpp.o  -L/opt/cuda/lib64 -Wl,-rpath,/opt/cuda/lib64:/opt/ros/lunar/lib:/opt/ros/lunar/lib64: /opt/ros/lunar/lib/libcamera_calibration_parsers.so /opt/ros/lunar/lib/libcv_bridge.so /opt/ros/lunar/lib64/libopencv_calib3d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_core3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaarithm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudabgsegm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudacodec3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudafeatures2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudafilters3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaimgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudalegacy3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaobjdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaoptflow3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudastereo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudawarping3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudev3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_features2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_flann3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_highgui3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_imgcodecs3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_imgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ml3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_objdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_photo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_shape3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_stitching3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_superres3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_video3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_videoio3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_videostab3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_viz3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_aruco3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_bgsegm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_bioinspired3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ccalib3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cvv3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_datasets3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_dpm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_face3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_freetype3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_fuzzy3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_hdf3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_line_descriptor3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_optflow3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_phase_unwrapping3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_plot3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_reg3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_rgbd3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_saliency3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_stereo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_structured_light3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_surface_matching3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_text3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xfeatures2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ximgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xobjdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xphoto3.so.3.2.0 /opt/ros/lunar/lib/libdynamic_reconfigure_config_init_mutex.so /opt/ros/lunar/lib/libimage_transport.so /opt/ros/lunar/lib/libmessage_filters.so /opt/ros/lunar/lib/libnodeletlib.so /opt/ros/lunar/lib/libbondcpp.so -luuid -ltinyxml /opt/ros/lunar/lib/libclass_loader.so -lPocoFoundation -ldl /opt/ros/lunar/lib/libroslib.so /opt/ros/lunar/lib/librospack.so -lpython3.5m -lboost_program_options-mt -ltinyxml2 /opt/ros/lunar/lib/libroscpp.so -lpthread -lboost_signals-mt -lboost_filesystem-mt /opt/ros/lunar/lib/librosconsole.so /opt/ros/lunar/lib/librosconsole_log4cxx.so /opt/ros/lunar/lib/librosconsole_backend_interface.so -llog4cxx -lboost_regex-mt /opt/ros/lunar/lib/libxmlrpcpp.so /opt/ros/lunar/lib/libroscpp_serialization.so /opt/ros/lunar/lib/librostime.so /opt/ros/lunar/lib/libcpp_common.so -lboost_system-mt -lboost_thread-mt -lboost_chrono-mt -lboost_date_time-mt -lboost_atomic-mt -lconsole_bridge -lglib-2.0 -lgobject-2.0 -latk-1.0 -lgio-2.0 -lgthread-2.0 -lgmodule-2.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lpangocairo-1.0 -lpangoft2-1.0 -lpangoxft-1.0 -lgdk-x11-2.0 -lgtk-x11-2.0 /opt/ros/lunar/lib64/libopencv_cudabgsegm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaobjdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudastereo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_stitching3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_superres3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_videostab3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_aruco3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_bgsegm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_bioinspired3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ccalib3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cvv3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_datasets3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_dpm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_face3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_freetype3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_fuzzy3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_hdf3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_line_descriptor3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_optflow3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_plot3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_reg3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_saliency3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_stereo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_structured_light3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_surface_matching3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_text3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xfeatures2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ximgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xobjdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_xphoto3.so.3.2.0 -lboost_signals-mt -lboost_thread-mt -lboost_chrono-mt -lboost_system-mt -lboost_date_time-mt -lboost_atomic-mt /opt/ros/lunar/lib64/libopencv_cudafeatures2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_shape3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudacodec3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaoptflow3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudalegacy3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudawarping3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_video3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_viz3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_phase_unwrapping3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_rgbd3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_calib3d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_features2d3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_flann3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_objdetect3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_ml3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_highgui3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_photo3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaimgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudafilters3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudaarithm3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_videoio3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_imgcodecs3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_imgproc3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_core3.so.3.2.0 /opt/ros/lunar/lib64/libopencv_cudev3.so.3.2.0 
make[2]: Leaving directory '/tmp/portage/ros-lunar/image_view-1.12.20/work/image_view-1.12.20_build'

But reports missing libopencv_core3.so.3.2 without 0 in the end.

@allenh1
Copy link
Contributor

allenh1 commented Jun 14, 2017

Does this prevent the node from running?

@allenh1
Copy link
Contributor

allenh1 commented Jun 25, 2017

@archenroot could I get a little more info on this please?

@archenroot
Copy link
Author

@allenh1 - I was quite busy and going for vacation this Thursday for 2 weeks, so will get to this later in summer. I finally created temporarily my own opencv release to get this working, I will provide more info later.
Thx.

@allenh1
Copy link
Contributor

allenh1 commented Aug 8, 2017

@archenroot Just doing some repo cleanup. Is this still an issue?

@void-robotics
Copy link

I need help with this too @archenroot

@allenh1
Copy link
Contributor

allenh1 commented Jan 26, 2018

@nathangeorge1 Can you please give me as much info as you possibly can? distro, last time you built things, etc?

@void-robotics
Copy link

Hello @allenh1,

I can't even open up my camera to view in image_view because the camera is dependent on OpenCV, and it is throwing the exact same bug.

It looks like this:

error while loading shared libraries: libopencv_core3.so.3.2: cannot open shared object file: No such file or directory

My distro is kinetic. If I look into /opt/ros/kinetic/lib, i see libopencv_core3.so, libopencv_core3.so.3.3, and libopencv_core3.so.3.3.1, but not what I need. I can build my repository and also the camera libraries just fine, but this is a runtime error for me. Let me know if I can provide further info.

@allenh1
Copy link
Contributor

allenh1 commented Jan 26, 2018

This looks like the kinetic version of #138. I'll Fix this. There's a temporary fix for you in that thread, in the meantime.

@void-robotics
Copy link

If you're referring to
I had a few to investigate it now, and it seems that the libopencv_core*.so files end up in /opt/ros/lunar/lib64, and the image view files end up in /opt/ros/lunar/lib.
I don't see /opt/ros/kinetic/lib64 on my local machine, only /opt/ros/kinetic/lib.

If you're referring to emaint sync -r ros-overlay I don't have "emaint" installed on my system and it appears to cost $.

@allenh1
Copy link
Contributor

allenh1 commented Jan 26, 2018

emaint is a part of portage, actually.

allenh1@hunter-laptop ~/Downloads
$ equery files portage | grep emaint
/usr/lib/python-exec/python2.7/emaint
/usr/lib/python-exec/python3.5/emaint

As for the lack of kinetic directory... I'm not sure about that. I have the files installed in the directory for kinetic.

allenh1@hunter-laptop ~/Downloads
$ ls /opt/ros/kinetic/lib64 | grep libopencv_core
libopencv_core3.so
libopencv_core3.so.3.3
libopencv_core3.so.3.3.1

Are you confident you are using this overlay for installation? Can you please link to the instructions you used to install ROS on your machine? How up to date are your packages?

@allenh1
Copy link
Contributor

allenh1 commented Jan 26, 2018

Ah, I see. @nathangeorge1 are you running Gentoo Linux?

@void-robotics
Copy link

I don't know if I'm using ros-overlay, but this runtime error is coming from the repo "lovepark/o3d3xx-ros" (I referenced the issue to another guy also looking into this) which is using ROS to activate the camera.

I don't believe I'm using Gentoo; I should be using Ubuntu 16.04.

@void-robotics
Copy link

A local engineer from ROS helped me fix this issue. Basically, my camera was pulling the .so from /usr/lib; so I thought deleting the devel and build folders and redoing catkin_make would fix it, but what I forgot was that I manually copied files over to /usr/lib because the build tests were failing; so basically deleting those files and redoing catkin_make worked. Also, I didn't know that debian packages can be installed with dpkg, which also helped.

Now, the appropriate libopencv file is being linked to my executable.

@allenh1
Copy link
Contributor

allenh1 commented Jan 27, 2018

I should be using Ubuntu 16.04

Ya, that would make sense then. This repository is for Gentoo Linux installations of ROS, so I'm afraid I don't know much about what could possibly be affecting the specific package you mentioned.

Now, the appropriate libopencv file is being linked to my executable.

That's good to hear! Linker problems are always super fun to debug. Cheers!

@pholthaus
Copy link
Contributor

#510 could be related. I am not quite sure if there should be

  • /opt/ros/$ROS_DISTRO/lib and
  • /opt/ros/$ROS_DISTRO/lib64 and
  • /opt/ros/$ROS_DISTRO/lib6464.

@ptFraga
Copy link

ptFraga commented Apr 25, 2018

@nathangeorge1 can you help me? I'm having the same problem as you did, I think. I'm trying to install cv bridge and I get:

"CMake Error at /opt/ros/kinetic/share/OpenCV-3.3.1-dev/OpenCVModules.cmake:375 (message):
The imported target "opencv_core" references the file
"/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3.1"
but this file does not exist."

Can you give a little bit of more info about how you solved it?
thanks mate

@void-robotics
Copy link

hello @ptFraga,

Basically I was working with a package lovepark/o3d3xx-ros that wouldn't build correctly. I needed a certain opencv shared object file, but it wouldn't generate from the CMakeLists.txt. I believe the reason catkin_make wasn't working is because I manually tried to install (move files from the ROS package over to /opt/ros), which I think was preventing catkin_make from re-generating the necessary opencv .so file. When I went into the directory where I copied stuff over, deleted it, then ran catkin_make again, the correct .so was there.

@ptFraga
Copy link

ptFraga commented Apr 25, 2018

Hi,
I fixed it. My case was similar, I end up by forcing a reinstall of kinetic-opencv3 (normal install wasn't doing anything) and the packages went to the right place. thanks @nathangeorge1

@hpoleselo
Copy link

Did the same thing as @ptFraga and worked.
sudo apt install --reinstall ros-kinetic-opencv3

@zpzp307
Copy link

zpzp307 commented Jan 7, 2019

@ptFraga How do you fix this problem? thank you !

@ptFraga
Copy link

ptFraga commented Jan 9, 2019

Hi,

sudo apt install --reinstall ros-kinetic-opencv3

did the trick for me

@r7vme
Copy link

r7vme commented Feb 8, 2019

For me the problem was that LD_LIBRARY_PATH did not contain /opt/ros/kinetic/lib/x86_64-linux-gnu

So if you run container with just docker run you also want

source /opt/ros/kinetic/setup.bash

@flabrosse
Copy link
Contributor

I just spent 2 hours trying to understand why image_transport was claiming that compressed transport plugins were not there when they were. On lunar, opencv3 installs in /opt/ros/lunar/lib6464 (yes, not a typo) (with a 107 days old sync). Copying everything in /opt/ros/lunar/lib works fine.

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

8 participants