Difference between .a and .o
Hi, I have written some useful functions that I call from the programs that I code. The functions are compile into a .o object file with the followin:
gcc -c func_useful.c
I'd then normally compile it into my programs if I need them with the following:
gcc -o executableName executableSrc.c func_useful.o -lc -lpthread
However, what's the difference between doing it this way versus me using "ar" to compile func_useful.c into func_useful.a?
Both ways require the code to be statically linked in to the executable before run time.
|