@ Static Library
# gcc -c fred.c bill.c
# ar -crv libfoo.a fred.o bill.o // libfoo.a created
r - fred.o
r - bill.o
# ar -t libfoo.a (or nm libfoo.a) // check including object files in libfoo.a
bill.o
fred.o
# gcc main.c -L/usr/lib -lfoo
@ Option
-L : Location of library directories
-l : library name
# gcc -c fred.c bill.c
# ar -crv libfoo.a fred.o bill.o // libfoo.a created
r - fred.o
r - bill.o
# ar -t libfoo.a (or nm libfoo.a) // check including object files in libfoo.a
bill.o
fred.o
# gcc main.c -L/usr/lib -lfoo
@ Option
-L : Location of library directories
-l : library name
No comments:
Post a Comment