Mail Archives: djgpp/1997/08/04/00:20:05
Gary Tan wrote:
>
> Hi,
> can someone pls enlighten me on how to create a library
> ("lib*.a") file??? I've read the readme.1st and faq, but can't seem to
> find any clues?
Libraries are constructed with the 'ar.exe' program. You can look up
the details in the docs, but the basic syntax to create a library is
thus:
ar rvs libmylib.a file1.o file2.o file3.o file4.o [...]
The 'rvs' flags tell ar to 1) create or replace files in the library
('r'), 2) give details as to what it's doing ('v'), and 3) build a
symbol table for the library ('s'). The second argument is the name of
the library and the rest of the arguments specify files to add.
Wildcards are acceptable.
> btw, is copying a library from the UNIX system library dir. to
> My DJGPP\lib okay? I mean is the library cross-platform?
Libraries are never cross-platform, as they represent object code
compiled for a particular machine architecture. You must find the
source for this library, port it to MS-DOS, and rebuild it.
> also. If I create a class called Chi_Array, can I use Array
> instead after I
>
> typedef Chi_Array Array;
Certainly. A typedef makes the new type exactly equivalent to its
definition. Examples:
typedef struct junk JUNK;
JUNK data; /* = struct junk data; */
typedef JUNK[100] BIGLIST;
BIGLIST list, list2; /* struct junk list[100], list2[100]; */
hth!
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -