I'm writing a small but useful C library (function is irrelevant). I'm experienced at programming but not more administrative things like autotools (I know what I've needed to know so far). How would I take my C file of library code and make a precompiled header, so that any implementing program could just go
instead of having to specify the local C file during compilation? I want this to be somewhat professional and part of that is having a professional interface for implementing Unix developers.
Thanks for your responses
This is the essence of what you do to create a static library
gcc -c myLibrary.c
ar crs libmyLibrary.a myLibrary.o
The first line compiles your library code to an object file. You can have as many of these as you like depending on what your library is supposed to do.
The second line then adds all the objects which make up the library.
You then give myLibrary.h and libmyLibrary.a to whoever.
So to use your library, someone might do
gcc -I/path/to/h prog.c -L/path/to/lib -lmyLibrary
Thank you very much. There's knowing how internal combustion works from a physics standpoint, and then there's knowing how to change the oil ... I'm still working on the latter :)