Mail Archives: djgpp/1997/03/05/17:35:42
On Wed, 5 Mar 1997, J wrote:
> how do I compile libraries in DOS using djgpp? What should I get as
> output files?
>
> I have no clue on this topic....I just switched over (kind of) from
> programming in UNIX, and I really want to be able to use the same
> libraries I used in UNIX.
>
> Um....I am using EZ-GCC if that makes any difference...
>
EZ-GCC is a toned-down version of DJGPP, is it not? I mean, it is the
same compiler (v.1.12m??) with a smaller set of support tools, isn't it?
If it is, you create a library by compiling the .c files to .o (using a -c
switch) like so:
gcc -O3 -o whatever.o -c whatever.c
and then put all the .o files into a lib*.a file using ar, like so:
ar -rvc libwhat.a whatever.o what1.o...
and, voila! you have a library. You would link it into an .exe with a
command like:
gcc -O3 -o which.exe -Lc:/whatever/lib which.c -lwhat
The -L switch tells gcc where to find the library files.
Hope this helps.
David May
ID Card Adminstrator
Albuquerque TVI
- Raw text -