Mail Archives: djgpp/1997/12/11/19:46:17
At 11:47 12/11/1997 -0600, Ryan McGee wrote:
>I'm interested in compiling a file into a library, but I cant find a help
>file telling me how to do this. Can anyone help me?
Sure. You use the `ar' program which came with Binutils, so you should have
it already. All you do is compile the files that you wish to go into the
library:
gcc -c file1.c
gcc -c file2.c
...
Then use `ar':
ar qcs mylib.a file1.o file2.o ...
This creates the library `mylib.a' containing all the listed object files.
The effect of linking with this library is just like linking with all the
object files.
Btw, please don't send posts in HTML. It's very annoying for those of us
whose mailers don't understand it.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -