If I have a.o, b.o, and c.o, how do I make ld link them into d.o, which is then linked into my main object file? All that I want to have happen is that all the symbols in the input files get combined into one big output file.
+1
A:
Found it. The -r option links files incrementally, so they can be used as input to ld.
computergeek6
2009-08-18 14:57:27
+2
A:
A concatenation of .o files is called a library. You create one with the ar library utility:
ar rvs mylib.a a.o b.o c.o
You can then link against the library:
cc main.c mylib.a
anon
2009-08-18 15:02:13