What\'s .a files in C programming in linux ? Is it library file ?
To merge with the math library libm.a you would type
cc -o program_name prog.c -lm
when you
The compiler "knows" to look for libm.a (or libm.so) when you pass it the option -lm
, because that's how the -l
option is documented and implemented: Take the characters following -l
(here just m
), prefix lib
and suffix .a
to get libm.a
Each library can have its own relation between header and library files used. It's uncommon for a header file to require no library at all, but it's more common for a library to have multiple header files.