public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Erik Christiansen <erik@dd.nec.com.au>
To: Bo Do <bodo@flygp.se>
Cc: gcc-help@gcc.gnu.org
Subject: Re: How handle static libraries?
Date: Mon, 17 Nov 2003 23:18:00 -0000	[thread overview]
Message-ID: <20031117231433.GA1024@dd.nec.com.au> (raw)
In-Reply-To: <000801c3aceb$a6d0ce20$2bfb0ec2@flygp.se>

On Mon, Nov 17, 2003 at 10:17:41AM +0100, Bo Do wrote:
> My question is, I have a library C which needs/uses library A. Can I
> compile/archive C in some way so that when I want to use C in a
> program, I just include C.h and link in C?

From: man ar;

       The GNU ar program creates, modifies,  and  extracts  from
       archives.   An  archive is a single file holding a collec­
       tion of other files in a structure that makes it  possible
       to  retrieve the original individual files (called members
       of the archive).

      ...

       ar is considered a binary utility because archives of this
       sort  are  most  often  used as libraries holding commonly
       needed subroutines.

      ...

Haven't used it myself, but there should be examples of its use in the
makefiles for gcc, etc. (I've seen "ar" commands whiz by, and they
seemed to be doing roughly what you intend, as far as a fleeting glimpse
can tell.)

At least, it's worth a look.

Erik

  reply	other threads:[~2003-11-17 23:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-17  9:09 Bo Do
2003-11-17 23:18 ` Erik Christiansen [this message]
2003-11-18  8:17   ` Bo Do
2003-11-18 18:20 lrtaylor
2003-11-19  8:22 ` Bo Do

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031117231433.GA1024@dd.nec.com.au \
    --to=erik@dd.nec.com.au \
    --cc=bodo@flygp.se \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).