Date: Thu, 18 Jan 1996 09:45:41 +0200 (IST) From: Eli Zaretskii To: Peter Plum Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Peter: More help with undefined references and yes -Wall On Wed, 17 Jan 1996, Peter Plum wrote: > If a certain.h file is needed do we need to have > the corresponding certain.c file as well? > I was trying to conpile the following file from > \SRC\BINUT-2.4\BINUTILS\ directory and got the > following response. As you can see I tried > -lpc. I did have to find and install bfd.h > ansidecl.h, bucomm.h and getopt.h where they > could be found. What else is necessary? > > Thanks again! > > -2.4\BINUTILS>gcc STRINGS.c -lpc -liostr > undefined reference to `program_name' You can't easily build a single program from a GNU package without building the entire package. GNU software is typically set up so that you have a few programs which share a common library (or libraries) of functions. The Makefile you get with the package builds the library(ies) first, then the programs. In your case, STRINGS needs some functions from the libraries whose source is included in the Binutils package, but you either didn't give their names on the command line or didn't build the libraries at all in the first place. The correct way of building STRINGS would be to go to the main directory where you unpacked the package and say `make strings'. That should do the necessary steps in the necessary sequence automatically (that is what Make and Makefiles are for).