When compiling in the Linux environment, sometimes "ld/;/usr/bin/ld:cannot find -lxxx” error prompt, what does this prompt mean? How to deal with it? The following small series teaches you how to deal with this situation.
often following error message appears in the source code linux environment to compile the application or lib:
code is as follows:
/usr /bin /ld : cannot find -lxxx
These messages will have different results when compiling different types of source code. For example:
The code is as follows:
/usr/bin/Ld: cannot find -lc
/usr/bin/ld: cannot find -lltdl
/usr/bin/ld: cannot find -lXtst
where xxx means The name of the library file, as in the above example: libc.so, libltdl.so, libXtst.so.
The naming convention is: lib+ library name (ie xxx) +.so.
There are three reasons for this:
1 The system does not have the corresponding lib
2 The corresponding lib version is incorrect
3 lib (.so file) symbolic link is incorrect, not linked to the correct library file (.so)
Solution:
(1) first judged in /usr/Is the corresponding symbolic file (.so)'s symbolic link under lib correct?
If you incorrectly change to the correct link target, you can solve the problem.
(2) If it is not caused by the problem of 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:
The code is as follows:
Error 1 is missing libc LIB
Error 2 missing libltdl's LIB
Error 3 missing libXtst's LIB
Take Ubuntu as an example:
Search for the corresponding LIB first The installed jobs are as follows:
The code is as follows:
apt-cache search libc-dev
apt-cache search libltdl-dev
apt-cache search libXtst-dev
Instance:
The following error message appears during the compilation of the source code gcin's Source Code:
The code is as follows:
/Usr/bin/ld: cannot find -lXtst
After checking, it is found:
The symbolic link of lib (.so file) is incorrect
The solution is as follows: Br>
The code is as follows:
cd /usr/lib
ln -s libXtst.so.6 libXtst.so
If in /usr/lib directory If the libXtst.so file is not found, then it means No library libXtst installation.
The solution is as follows:
The code is as follows:
apt-get install libxtst-dev
The above is /usr/bin/ld under Linux: The method of find -lxxx error is introduced. If you have this situation when compiling, you can try the above method to solve it.
Most users now use Windows systems. They all know that Windows systems are divided
The inode in the Linux file system is mainly used to store the basic information of files and direct
Linux many operations, lftp can be used for ftp file download and upload, login ftp
SELinux is an expansion preemptive access control security module for Linux that ca
The specific steps of hard disk partitioning under Linux
Introduction to the usr directory in Linux
Linux beginners need to understand the Bash command operation skills to share
Two classifications of Linux system commands
Linux to increase the resolution of VirtualBox
How to use Linux to periodically delete expired files using the command
Repairing database skills after Linux system crashes
What should I do if the Java process under Linux system disappears without cause?
Knowledge about file I/O operations under Linux
CentOS 6.6 system installation steps
What should I do if the device id of the Linux virtual machine does not match the drive letter?
Mobile hard disk /U disk installed _Windows7 system advantages and methods
How to solve the delay of Win7 network?
Cleverly deal with win2003 hardware failure problems
The wired mouse light is on but there is no response. How to solve it?
Win8 tile background set graphic tutorial
Record the detailed login time of Windows 7 system
Win8 system virtual hotspot sharing Internet access method
Windows 8 easy way to install rich language packs
Windows 8 does not display the lock screen setting technique