I'm fiddling around with GCC, trying to understand the various possibilities for linkage.
These are my questions:
Let's say I have two files
tools.candtools.h, and I create an archivelibtools.a(containingtools.o).Now I have some
prog.c, a program which includestools.hand uses some of its functions.are the following commands equivalent?
gcc -Wall prog.c libtools.a -o proggcc -Wall prog.c -ltools -o progregarding the
-lflag (man ldwasn't of much use unfortunately):a. What is the implicit pattern matching rule? -lX means "find the file named libX.a"?
b. Does
-lhave any real importance in the linking process besides finding the library lazily (closely related to 1 I guess)?c. How do I link a library named
lib.aortools.paz?