Date: Wed, 5 Mar 1997 15:16:29 -0700 (MST) From: David May To: J cc: djgpp AT delorie DOT com Subject: Re: compiling libraries... In-Reply-To: <331DBAB2.F7F@comports.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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