The - LM
option must be added to the GCC
command line when using the library functions declared in math. H
because the mathematical functions are located in libm. So
library files (these library files are usually located in the /lib
directory), - LM
option tells the compiler, The mathematical functions used in our program should be found in this library file. Most of the library functions used in this book (such as printf
) are located in libc. So
library files. When using the library functions in libc. So
, you don’t need to add the - LC
option when compiling. Of course, adding it is not wrong, because this option is the default option of GCC
C standard is mainly composed of two parts, one describes C syntax, the other describes C standard library. C standard library defines a set of standard header files, each of which contains some related functions, variables, type declarations and macro definitions. In order to support c language on a platform, it is necessary to implement not only c compiler but also c standard library. Only in this way can the implementation meet the C standard. For example, there are only C compilers and no complete C standard library in many SCM c language development tools
The most widely used C function library on Linux platform is glibc
, including the implementation of C standard library. Almost all C programs call glibc
library functions, so glibc
is the basis of C program running on Linux platform glibc
provides a set of header files and a set of library files, the most basic and most commonly used C standard library functions and system functions. In libc. So
library files, almost all C programs run on libc. So
, and some C programs for mathematical calculation rely on libm. So
, We will see that multithreaded C programs rely on libpthread. So
. In the future, when I say libc
, I specifically refer to the library file libc. So
, while when I say glibc
I refer to all the library files provided by glibc
glibc
is not the only basic C function library on Linux platform. Some people are developing other C function libraries, such as uclibc
for embedded systems
Similar Posts:
- /lib64/libc.so.6: version `GLIBC_2.14′ not found [How to Solve]
- ImportError: /lib64/libc.so.6: version `GLIBC_2.17′ problem solved
- Centos6 upgrades glibc-2.17 to solve requirements: libc. So. 6 (glibc)_ 2.14) (64bit) error resolution
- linux:/lib/libc.so.6: version `glibc_2.7′ not foun
- [Solved] VS error C4996: ‘scanf’: This function or variable may be unsafe.
- error: ‘to_string’ was not declared in this scope
- [Solved] Error in installing RPM package in CentOS – no key
- Hadoop “Unable to load native-hadoop library for y
- Ubuntu can’t find libc. So. 6
- Hi3516DV300 Chip Error: “undefined reference to ×”