Problem Description: after the compilation is successful (there is an executable file in the folder), an error is reported when running (Ubuntu) clip, and the error cannot be found So shared library (but shell can execute normally) solution (similar error reporting in pycharm)
/home/luoxinhao/Desktop/mywork/bin/Infantry: error while loading shared libraries: libopencv_features2d.so.4.5: cannot open shared object file: No such file or directory
Reason: the execution of clion may be different from the environment variables of our shell. The following is the solution
Method 1: each time you start the clion, use the terminal to enter the folder where the clion is located and input/clion.SH, it can be executed normally. (feasible but troublesome)
Method 2: soft link method (both shell error reporting and idle error reporting are feasible, but many libraries may need to be linked, one by one)
My clion was successfully modified in this way, but pycharm gave up seven or eight links without completing the chain
1.1 find files
find / -name lib**. So (missing DLL)
1.2 establishing soft links
ln -s /path/to/lib**. so /usr/lib
1.3 sudo ldconfig
Method 3: modify LD_LIBRARY_Path (for me, it can only solve the shell error, and the modified idle still reports an error)
sudo gedit ~/. bashrc
export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH
sudo source ~/.bashrc
Method 4: modify/etc/LD so.Conf (ibid.)
vim /etc/ld.so.conf
add /where/you/install/lib
sudo ldconfig
Method 5: add it to the environment variable (available, used to solve the error reported by idle, which may need to be used in conjunction with method 3, without separate attempt)
First, open pycharm and modify the environment variable of the running configuration in the upper right corner
If you already have an environment variable, type a semicolon after it and paste it.
Paste content is similar to method 3
For example, method 3 is as follows
export LD_LIBRARY_PATH="/opt/intel/openvino_2021.4.689/opencv/lib:$LD_LIBRARY_PATH"
Then add after the semicolon
LD_LIBRARY_PATH=/opt/intel/openvino_2021.4.689/opencv/lib
Read More:
- Error: loading shared libraries: cannot open shared object file: No such file or directory
- Linux Ubuntu ImportError: Libtk8.5.so: cannot open shared object file:No such file Install tkinter Library
- [Solved] error while loading shared libraries: libjson.so.0: cannot open shared object file: No such file or
- [Solved] mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No s
- [Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory
- [Solved] Python Import mmcv Warning: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- Petalinux Failed to open PetaLinux lib: librdi_commonxillic.so: cannot open shared object file:
- [Solved] error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such…
- [Solved] Ubuntu Compile AOSP Error: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
- [Solved] /usr/local/libexec/mecab/mecab-dict-index: error while loading shared libraries: libmecab.so.2: cannot open shared object file: No such file or directory
- [Solved] error while loading shared libraries: libmpc.so.3: cannot open shared object file
- [Solved] openssl error: libcrypto.so.1.0.0: cannot open shared object file: Error 40
- [Ubuntu] How to Solve dpkg Error: dpkg: error: failed to open package info file ‘/usr/local/var/lib/dpkg/status’ for reading: No such file or directory
- Centos7.2 Install vscode Error: error while loading shared libraries: libxkbcommon.so.0: cannot open shared pro
- [Solved] pxp_lib.h:19:10: fatal error: linux/pxp_device.h: No such file or directory
- [Solved] Ubuntu Execute uci Error: uci: error while loading shared libraries: lib
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Error while loading shared libraries [How to Solve]
- error while loading shared libraries [How to Solve]
- [Solved] Denseflow Install Error: fatal error: opencv2/cudaarithm.hpp: No such file or directory