Mail Archives: djgpp/1998/08/02/23:39:38
On 3 Aug 98 at 9:57, Goh Yong Kwang wrote:
> I want to create a library but is not quite sure how to do it.
>
> I think that the first step would be to compile all the c/c++ file into
> object file (.o). Then from there, use the ar utility with the -r switch
> to add all the .o files to the library. Then copy the library archive
> (.a) to djgpp/lib directory. (This is the easiest step. Otherwise I'll
> have to fiddle with the djgpp.env file to tell djgpp where to look for my
> library).
>
> Is the procedure correct? Please correct me if I'm wrong.
This procedure should work. Doesn't it?
You forgot to mention creating one or more header files for the
library though. It's not essential, but if you don't do this then
the implicit declarations could fail to match the real functions, or
the user could misprototype them. Similarly, variables' types may be
muddled by the user's incorrect declarations.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -