Library File not found during compilation

Source: Internet
Author: User
When compiling an application or lib source code in Linux, the following error message is often displayed:/usr/bin/ld: the cannot find-LXXX messages have different results as different source codes are compiled, for example,/usr/bin/ld: cannot find-LC/usr/bin/ld: cannot find-lltdl/usr/bin/ld: cannot find-lxtst. xxx indicates the name of the library file, as shown in the preceding example: libc. so, libltdl. so, libxtst. so. The naming rule is: Lib + Library name (XXX) +. So. There are three possible reasons for this: 1. The system has not installed the corresponding lib version of lib2. 3 lib (. the symbolic link of the so file is incorrect and is not linked to the correct library file (. so) If libxtst cannot be found in the/usr/lib directory. so file, it indicates that the libxtst library is not installed. The solution is as follows: APT-Get install libxtst-Dev
 

Solution/usr/lib/ld: cannot find-LC:
1. Search for the libc. So file in the system. An invalid link is found and deleted.
Libc. so.6, under the/usr/lib/i386-linux-gnu.
2. Go to the usr/lib directory: CD
/Usr/lib
3. Build link: sudo ln-SV/lib/i386-linux-gnu/libc. so.6
Libc. So

Solution/usr/lib/ld: cannot find-LM:
1. Search for the libm. So file in the system. Search for a libm. So file.
Under/usr/lib/i386-linux-gnu.
2. Go to the usr/lib directory: CD/usr/lib
3. Create a link: sudo
Ln-SV/usr/lib/i386-linux-gnu/libm. So libm. So

 

 

However, this problem should be due to the fact that the Library's header file library is not installed:

[[Email protected] lib] # Yum list all | grep ltdl libtool-ltdl.i386 1.5.22-7. el5_4 installed libtool-ltdl-devel.i386 1.5.22-7. el5_4 centos5.5-32

Installation header file:

[[Email protected] lib] # Yum-y install libtool-ltdl-devel.i386

...

The error is indeed caused by the uninstalled devel header file.

[[E-mail protected] lib] # rpm-QL libtool-ltdl-devel.i386/usr/include/ltdl. h/usr/lib/libltdl. a/usr/lib/libltdl. la/usr/lib/libltdl. so

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.