"Turn" LINUX/USR/BIN/LD cannot find solution

Source: Internet
Author: User
Tags vmware server

Original URL: http://blog.csdn.net/mzwang123/article/details/6702889

Problem:
Compiling the source code for the application or LIB in the Linux environment often comes with the following error message:

  • /usr/bin/ld:cannot find-lxxx


These messages will have different results as you compile different types of source code, such as:

  • /usr/bin/ld:cannot FIND-LC
  • /usr/bin/ld:cannot Find-lltdl
  • /usr/bin/ld:cannot FIND-LXTST


where xxx is the function library file name, as in the above example: libc.so, libltdl.so, libxtst.so.
Its naming rules are: lib+ library name (that is, XXX) +.so.


There are three scenarios in which this can occur:

1 system does not install the corresponding Lib
2 The corresponding Lib version is incorrect
3 lib (. so file) Symbolic link is incorrect and is not linked to the correct library file (. So)


For the above three reasons there is an article written very good can refer to the 4th of this article:
gcc Command Xiang Solution


Workaround:
(1) Determine if the symbolic link of the corresponding function library file (. So) under/usr/lib is correct
The problem can be solved by incorrectly changing the correct link target.

(2) If the problem is not caused by symbolic link, but the system lacks the corresponding Lib installation lib can be solved.

(3) How to install the missing lib:
Take the above three error messages as an example:

Error 1 libc Lib is missing
Error 2 Libltdl Lib is missing
Error 3 libxtst Lib is missing

 

Take Ubuntu for example:
First, search for the corresponding Lib and then install the job such as:

Apt-cache Search Libc-dev
Apt-cache Search Libltdl-dev
Apt-cache Search Libxtst-dev


Instance:
The following error message appears when compiling the source code for IME gcin:

/usr/bin/ld:cannot find-lxtst


After examination, it is found that:
Symbolic link for Lib (. so file) is incorrect

Here's how to fix it:

Cd/usr/lib
Ln-s libxtst.so.6 libxtst.so


If the libxtst.so file is not found in the/usr/lib directory, then the system does not have a library of LIBXTST installed.
The solution is as follows:

apt-get Install Libxtst-dev

Environment: VMware Server + RHEL5.4 +fcitx3.63 encountered an error while performing make

[[email protected] fcitx-3.6.3] Make

Make All-recursive
MAKE[1]: Entering directory '/home/oracle/desktop/fcitx-3.6.3 '
Making All in doc
MAKE[2]: Entering directory '/home/oracle/desktop/fcitx-3.6.3/doc '
MAKE[2]: Nothing to is done for ' all '.
MAKE[2]: Leaving directory '/home/oracle/desktop/fcitx-3.6.3/doc '
Making All in xpm
MAKE[2]: Entering directory '/home/oracle/desktop/fcitx-3.6.3/xpm '
MAKE[2]: Nothing to is done for ' all '.
MAKE[2]: Leaving directory '/home/oracle/desktop/fcitx-3.6.3/xpm '
Making all in Lib
MAKE[2]: Entering directory '/home/oracle/desktop/fcitx-3.6.3/lib '
MAKE[2]: Nothing to is done for ' all '.
MAKE[2]: Leaving directory '/home/oracle/desktop/fcitx-3.6.3/lib '
Making All in SRC
MAKE[2]: Entering directory '/HOME/ORACLE/DESKTOP/FCITX-3.6.3/SRC '
Gcc-o2-fno-strength-reduce-g-o2-d_enable_tray-wall-lxpm-lxtst-lpthread-o fcitx ic.o ime.o InputWindow.o Ke YLIST.O main.o mainwindow.o myerrorshandlers.o punc.o py.o pyfa.o pymaptable.o pyparser.o sp.o tools.o ui.o table.o XIM.O QW.O tray.o traywindow.o dbus.o vk.o about.o quickphrase.o autoeng.o extra.o internalversion.o ImeRemote.o. /lib/libximd.a-lx11
/usr/bin/ld:cannot FIND-LXTST
Collect2:ld returned 1 exit status
MAKE[2]: * * * [FCITX] Error 1
MAKE[2]: Leaving directory '/HOME/ORACLE/DESKTOP/FCITX-3.6.3/SRC '
MAKE[1]: * * * [all-recursive] Error 1
MAKE[1]: Leaving directory '/home/oracle/desktop/fcitx-3.6.3 '
Make: * * * [ALL] Error 2

Checked under directory/usr/bin/ld not found LXTST

"Turn" LINUX/USR/BIN/LD cannot find solution

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.