Linux Run Error: Error while loading shared Libraries:xxx.so.0:cannot open shared object File:no such fil

Source: Internet
Author: User

Links can be specified by the-L and-l, so the link can pass, but at runtime, the system still cannot find the specified library, which requires a simple configuration.

Workaround 1:

You can add the path of your own library directly to your/etc/ld.so.conf file . But generally the content in this file is a "include/etc/ld.so.conf.d/*.conf", so it is best to create a new file under the/etc/ld.so.conf.d/directory, such as "xxx.conf", and then add the path of your own library into this conf file.

After modifying the file, run/sbin/ldconfig-v as root. This step is essential, don't lose it.

Then re-run your own program, there is no problem.

Workaround 2:

If you know the version number of a linked library file, you can create a soft-link file for that library file in the same directory as the library file, such as:

I want to link libsdl.so, can use Ln-s libsdl.so libsdl-1.2.so.o to create a soft link with the version number. Then run the program again and it will be fine.

Linux Run Error: Error while loading shared Libraries:xxx.so.0:cannot open shared object File:no such fil

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.