IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.56k stars 4.82k forks source link

error while loading shared libraries: librealsense2-gl.so.2.34 #8130

Open fightmoney opened 3 years ago

fightmoney commented 3 years ago

Required Info
Camera Model T265
Firmware Version 2.40
Operating System & Version Linux (Ubuntu 18.04)
Kernel Version (Linux Only) 5.4.0
Platform PC
SDK Version 2.4.0
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

I installed the SDK a mouth ago, it worked well !

But there is something wrong with it ,so I use dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge to uninstall it. And I find and delete anything about librealsense, just like sudo rm -r librealsense2*. Then I reinstall the SDK,follow the librealsense/doc/distribution_linux.md, and then sudo apt update && sudo apt upgrade but realsense-viewer: error while loading shared libraries: librealsense2-gl.so.2.34: cannot open shared object file :No such file or directory

ev-mp commented 3 years ago

@fightmoney , there is a discrepancy between the declared (and probably installed) 2.40 and the actual runtime SDK version 2.34. Apparently you have more than one version of the SDK available, so you need to select the proper one to compile and run. Use ldd exe_file_name to list the actual SO files being loaded and their location on HD.

Also note that the uninstall routine you specified applies if the SDK was deployed with sudo apt install .... When building from source code then the removal shall be done with sudo make uninstall.

fightmoney commented 3 years ago

@ev-mp thanks for you reply, but there are some questions. I find librealsense location in my compute. So you mean I have to delete all of this? IMG_20210111_110237

ev-mp commented 3 years ago

@fightmoney , it is not recommended to modify the content of system libs as it can break Ubuntu. You need to review those files and decide based on the installation you made and the intended usage. In general there is nothing wrong with having multiple versions installed, however you need to be precise about the version you use in building/linking and running phases.

One method to avoid this complexity is to compile the SDK as static lib, but then again - it depends on the installation type and other dependencies that you might have.

fightmoney commented 3 years ago

@ev-mp I am a new hand in linux, I think your advice maybe difficult for me. If I reinstall the version of 2.34.0 rather than 2.41.0, can it work? How to install it?