Message-Id: <199808030339.EAA31459@sable.ox.ac.uk> Comments: Authenticated sender is From: George Foot To: Goh Yong Kwang Date: Mon, 3 Aug 1998 04:38:22 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: How to create a library? Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk CC: djgpp AT delorie DOT com Precedence: bulk On 3 Aug 98 at 9:57, Goh Yong Kwang wrote: > I want to create a library but is not quite sure how to do it. > > I think that the first step would be to compile all the c/c++ file into > object file (.o). Then from there, use the ar utility with the -r switch > to add all the .o files to the library. Then copy the library archive > (.a) to djgpp/lib directory. (This is the easiest step. Otherwise I'll > have to fiddle with the djgpp.env file to tell djgpp where to look for my > library). > > Is the procedure correct? Please correct me if I'm wrong. This procedure should work. Doesn't it? You forgot to mention creating one or more header files for the library though. It's not essential, but if you don't do this then the implicit declarations could fail to match the real functions, or the user could misprototype them. Similarly, variables' types may be muddled by the user's incorrect declarations. -- george DOT foot AT merton DOT oxford DOT ac DOT uk