In the gcc manual it is given that "The C standard library itself is stored in ‘/usr/lib/libc.a’". I have gcc installed, but could not find libc.a at the said location. Curious to know where is it located.
I find many .so files in /usr/lib location. What are those?
The C standard library itself is stored in '/usr/lib/libc.
The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it.
On Mac and iOS the C Standard Library implementation is part of libSystem, a core library located in /usr/lib/libSystem.
Library functions are built-in functions that are grouped together and placed in a common location called library. Each function here performs a specific operation. We can use this library functions to get the pre-defined output. All C standard library functions are declared by using many header files.
If you are looking for libc.a
:
$ gcc --print-file-name=libc.a /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libc.a
A few things:
.a
files are static libraries, .so
means shared object and is the Linux equivalent of a DLLHope that clears it up for you. As for the location, it's almost certainly going to be in /usr/lib/libc.a
and / or /usr/lib/libc.so
. Like I said, the .so one is the more common.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With