From: j DOT aldrich6 AT genie DOT com Message-Id: <199607130546.AA031266811@relay1.geis.com> Date: Sat, 13 Jul 96 05:30:00 UTC 0000 To: mmhamze AT mail DOT utexas DOT edu Cc: djgpp AT delorie DOT com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Subject: Re: Linking into a library usi Reply to message 5898125 from MMHAMZE AT MAIL. on 07/12/96 12:02PM >I looked into the docs that come with DJGPP ver2, and I can not seem >to find the command line switches that I should use to link objects >(or assemble and compile and link) into a libray (not an exe). Can >someone give an example of the command line switches needed to do >that. To create a library under DJGPP, you use the 'ar' function. This is part of the standard distribution and there's quite comprehensive online documentation (info Binutils ar). Simply, to create a library, do the following: Compile your code into object files (.o) by giving the -c switch to gcc. Archive the files into a library with the following command: ar rvs ... Thereafter, as long as that library is in the current LIBRARY_PATH as defined in DJGPP.ENV, you can simply link it with -l when you compile like any other library. You could also specify the directory it's in with the -L switch. John