Mail Archives: djgpp/1996/03/17/09:56:05
On Fri, 15 Mar 1996, Juan M. Lopez wrote:
> I am a new GCC user. I want to know how
> to compile my own libraries and use them
> later in my programs.
>
> I have some .H and .C files but I do not
> know how I can compile them only one time
> and leter use them for other main program.
Compile all of the sources to produce .o object files:
gcc -c file1.c
gcc -c file2.c
gcc -c file3.c
...
Then put them into the library:
ar rvs libmylib.a file1.o file2.o file3.o ...
Then use them to link your programs:
gcc -o myprog myprog.c .... -lmylib
- Raw text -