Ubuntu Tutorial: a solution that prompts the library file does not exist when the library cannot be linked

Source: Internet
Author: User
/Home/bear/QtProgram/opencv001-build-desktop/opencv001: errorwhileloadingsharedlibraries: libopencv_highgui.so.2.3: cannotopen#dobjectfile: Nosuchfileordirectoryerrorwhileloading

/Home/bear/QtProgram/opencv001-build-desktop/opencv001: error while loading shared libraries: libopencv_highgui.so.2.3: cannot open shared object file: No such file or directory

Error while loading shared libraries: libXXX. so.1.2.3: cannot open shared object file

In this case, you can locate libXXX. so.1.2.3 (If your file system has changed from the previous one, for example, if you have installed a library development kit that may be required, you need to locate-u)

Then, if you find libXXX. if so.1.2.3 does exist, use libXXX. add the directory where so.1.2.3 is located to/etc/ld. so. conf, or in/etc/ld. so. conf. d/create a new file, such as XXX. conf, whose content is libXXX. the directory where so.1.2.3 is located.
If libXXX. so.1.2.3 does not exist, you may not have installed the program containing the library. Generally, you can find the corresponding software by google "XXX linux.

If the prompt is error while loading shared libraries: libXXX. so, but your system has libXXX. so.5, you can set it to libXXX. so.5
Create a soft link ln-s libXXX. so.5 libXXX. so

For example, the following prompt appears when I run the sample program in an ACE development kit:
./Logging_app: error while loading shared libraries: libACE. so.5.4.7: cannot open shared object file: No such file or directory

[Root@www.linuxidc.com ld. so. conf. d] # locate libACE. so.5.4.7
/Opt/ace/libACE. so.5.4.7
/Opt/ace/lib/libACE. so.5.4.7
[Root@www.linuxidc.com ld. so. conf. d] # vi ace. conf

There is only one line in ace. conf:/opt/ace/lib

Then execute ldconfig

OK. Now there is no error when you execute logging_app.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.