Error resolution errors while loading shared Libraries:libxxx.so.x:cannot open Shared object file:no such file

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/david_xtd/article/details/7625626

Premise: Ubuntu-debug machine on the PDU-IVT submitted to SVN, want to verify the success of the direct make on other ordinary machine, the compiled user program can run.

The work PC is equipped with VMware, which has the same Ubuntu version as the Ubuntu-debug machine, which is the Ubuntu 11.10 version.

VMware's home directory has a directory pdu-ivt, which is updated from SVN and copied directly.

On the Ubuntu-debug machine, make succeeds, and the generated binary executable PDU can also run and connect successfully with switch;

But when you run make in VMware, the working PC, you are prompted with an error:

[CPP]View Plaincopyprint?
    1. /usr/bin/ld:cannot FIND-LCISCOENERGYWISESDK
    2. Collect2:ld returned 1 exit status
    3. Make: * * [PDU] Error 1

Analysis Reason: The LD prompt cannot find the library file, and the library file is in the current directory.

The default directory for the linker ld is/lib and/usr/lib, and if you put it on a different path, you need to let LD know where the library file is.

Method 1:

Edit the/etc/ld.so.conf file and add the directory where the library file is located in a new line;

Run Ldconfig to update the/etc/ld.so.cache file;

Method 2:

Create a new file with a. conf suffix in the/etc/ld.so.conf.d/directory, and add the directory where the library file is located in the file;

Run Ldconfig to update the/etc/ld.so.cache file;

I think the second method is more convenient, the original system is the smallest change. Because the content of the/etc/ld.so.conf file is include/etc/ld.so.conf.d/*.conf

Therefore, any file with a. conf suffix that is added to the/etc/ld.so.conf.d/directory can be identified.

[CPP]View Plaincopyprint?
    1. My Practice:
    2. 1. Put all the users need to use the library to/usr/loca/lib;
    3. 2. Create a new file usr-libs.conf in the/etc/ld.so.conf.d/directory, with the content:/usr/local/lib
    4. 3. #sudo Ldconfig

The Ld.so.cache update is incremental, just like the path system environment variable, not re-established from scratch, but cumulatively.

The Ld.so.cache file is created from scratch, unless the power is turned back on.

Error resolution errors while loading shared Libraries:libxxx.so.x:cannot open Shared object file:no such file

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.