www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/19/08:01:12

From: kagel AT quasar DOT bloomberg DOT com
Date: Fri, 19 Jul 1996 07:54:06 -0400
Message-Id: <9607191154.AA03017@quasar.bloomberg.com >
To: akroev AT sn DOT no
Cc: djgpp AT delorie DOT com
In-Reply-To: <jnt7xg8CV84b091yn@sn.no> (akroev@sn.no)
Subject: Re: How do I create my own libraries ?
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   From: akroev AT sn DOT no (Arne Knut Roev)
   Date: 19 Jul 1996 03:21:32 +0200

   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++.

Compile your source to object files (*.o), use 'ar' (included with DJGPP) to
build a library file named something like libMYLIB.a (the "lib" prefix and .a
suffix are required), and run ranlib to build a symbol table in the library.


	gcc -c my*.c
	ar -r libmylib.a my*.o
	ranlib libmylib.a
	copy mylib.a \mylibdir

You can then us libmylib like any other DJGPP library:

	gcc -o myapp.exe app*.c -L/mylibdir -lmylib

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


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