Date: Sun, 17 Mar 1996 16:49:39 +0200 (IST) From: Eli Zaretskii To: "Juan M. Lopez" Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Dubts In-Reply-To: <9603151142.AA27232@sun.soe.clarkson.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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