Date: Fri, 19 Aug 94 00:04:45 EDT From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock) To: OKRA AT max DOT tiac DOT net Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: libraries Reply-To: babcock AT cfa DOT harvard DOT edu > So let me restate the problem. In order to compile graph.c to a .o > file, it needs access to the variables. In order to compile a program > that uses graph.c, it _also_ needs access to the variables. So I end up > with two definitions of each variable used and, thus, no executable program. Your variables need to be declared extern everywhere but one place. One way of doing this is to make the .h files look like: #ifndef EXTERN #define EXTERN extern #endif EXTERN int foo; ... Before the #include in your main routine, insert #define EXTERN