Reply-To: From: "Arthur" To: "DJGPP Mailing List" Subject: RE: help please Date: Fri, 18 Sep 1998 16:37:13 +0100 Message-ID: <001701bde31a$34d6f740$eb4d08c3@arthur> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <19980918000252.26170.00000996@ng136.aol.com> Importance: Normal Precedence: bulk > >What does UNDEFINED REFERENCE mean and how do I fix it? > > This is a linker error. It comes about when a reference in a > particular module > is present, and its definition is expected to exist in another > module but isn't > found during the linking. For example, > > struct X { > void y(); > }; > > void f() { > X *x; > x -> y(); > } > > will compile because the definition of X::y doesn't have to be in the same > module as the declaration of X. The solution is to be sure that > a file with > the definition of X::y is linked into the executable. This file > should have, > > void X::y() {...} > > in it. Or, you can just put this into the same file that references the > function, somewhere after the declaration and somewhere before > the reference. Note that the above only works for C++. James Arthur jaa AT arfa DOT clara DOT net ICQ#15054819