delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/20/23:33:40

Xref: news2.mv.net comp.os.msdos.djgpp:6202
From: brucef AT central DOT co DOT nz (Bruce Foley)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How do I create my own libraries ?
Date: Sat, 20 Jul 1996 19:30:17 GMT
Organization: Internet Company of New Zealand
Lines: 31
Message-ID: <4srffn$loe@status.gen.nz>
References: <jnt7xg8CV84b091yn AT sn DOT no>
NNTP-Posting-Host: brucef.central.co.nz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

akroev AT sn DOT no (Arne Knut Roev) wrote:

>No, I am not working on a new libc. I am simply writing a number of
>more or less useless ;-) functions, and I would like to add them to
>a library of my own.

>How do I do this, using djgpp ver. 2.0 ?

> ( And, while we are at it, how do I use the library, once I have
>   created it ?)

>I have tried to find this info in the info-files, and in the FAQs,
>but so far I have not been able to locate any relevant info.

>BTW: I'm talking C, _not_ C++.

Use the "ar" utility.

after building the objects that you want to include in the
library, use the following command:

ar rs mylib.a myobj1.o myobj2.o....

BTW, I was wondering, when a program uses a function
from a library, does the whole library get linked, or just
the function you are calling?

Regards, Bruce.



- Raw text -


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