delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/19:46:17

Date: Thu, 11 Dec 1997 16:44:50 -0800 (PST)
Message-Id: <199712120044.QAA12578@adit.ap.net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Libs

At 11:47  12/11/1997 -0600, Ryan McGee wrote:

>I'm interested in compiling a file into a library, but I cant find a help
>file telling me how to do this. Can anyone help me?
Sure. You use the `ar' program which came with Binutils, so you should have
it already. All you do is compile the files that you wish to go into the
library:
gcc -c file1.c
gcc -c file2.c
...

Then use `ar':
ar qcs mylib.a file1.o file2.o ...

This creates the library `mylib.a' containing all the listed object files.
The effect of linking with this library is just like linking with all the
object files.

Btw, please don't send posts in HTML. It's very annoying for those of us
whose mailers don't understand it.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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