www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/11/03:31:42

Newsgroups: comp.os.msdos.djgpp
From: fredex AT fcshome DOT stoneham DOT ma DOT us (Fred Smith)
Subject: Re: How to build and use a new library ?
X-Newsreader: TIN [version 1.2 PL2]
Organization: None!
Message-ID: <F0My6z.Aux@fcshome.stoneham.ma.us>
References: <6vmmiv$rnl$1 AT gemini DOT ntu DOT edu DOT tw>
Date: Sat, 10 Oct 1998 23:49:47 GMT
Lines: 35
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tzyy-Jiann Wang(TA442-95) (tjwang AT ccserv1 DOT ee DOT ntu DOT edu DOT tw) wrote:

:      I want to add my frequently-used functions to a new library under
: DJGPP. How can I do that ? Is there any GNU program which can add and
: delete the functions in the library and display all the remaining
: functions in the  library ? I use RHIDE to develope my program. How do I
: set the command-line option to include the user-built library ?   

: thanks for your help 

: T.J. Wang

You create/manipulate libraries (archives) with the 'ar' program. If
you've installed the info files, try "info ar".

Briefly, if you have files a.c, b.c, and c.c, which compile into a.o,
b.o, and c.o, and you wish to make your own library "libabc.a" you do
this by:

	ar rv libabc.a a.o b.o c.o

and link your program "x.c" against that library:

	cc -o x x.c -labc

Fred


--
---- Fred Smith -- fredex AT fcshome DOT stoneham DOT ma DOT us -----------------------------
  "And he will be called Wonderful Counselor, Mighty God, Everlasting Father,
  Prince of Peace. Of the increase of his government there will be no end. He 
 will reign on David's throne and over his kingdom, establishing and upholding
      it with justice and righteousness from that time on and forever."
------------------------------- Isaiah 9:7 (niv) ------------------------------

- Raw text -


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