www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/17/09:56:05

Date: Sun, 17 Mar 1996 16:49:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Juan M. Lopez" <jmlopez AT dcom DOT upv DOT es>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Dubts
In-Reply-To: <9603151142.AA27232@sun.soe.clarkson.edu>
Message-Id: <Pine.SUN.3.91.960317164652.16543O-100000@is>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019