RE: [Dev-C++] Newbie linking errors: 'undefined reference'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2002-02-09 20:54:23
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Devin Carless > Sent: Saturday, February 09, 2002 9:47 PM > To: dev...@li... > Subject: [Dev-C++] Newbie linking errors: 'undefined reference' > > > > Generally, I like to lurk and listen a bit before I post, > but this time I'm really at wit's end. > > My project, a simple game based on the old Lost Worlds > booklets, keeps generating undefined reference errors in the > linking stage. They look like this: > > d:/devin/projects/lostworlds/womanqsprototype.o(.data$_vt$11Wo > manQSBook+0x5c > ):womanqsprototy: undefined reference to > `BaseBook::Lookup(unsigned short, unsigned short) const' > > The compiler had no problems with just such a function, but > the linker does. (I'm using Dev-C++ 4 with MinGW 2.95.2, > with the -v -H flags for the linker.) I don't know what > 'undefined reference' means, and nowhere on the Net (that Generally "undefined reference" means there is no definition for such thing. In your case BaseBook::Lookup(unsigned short, unsigned short) const Probably it has to do with the graphics library you use. > Google can find) is there a document that tells me, either. > Sometimes I can temporarily make them go away with cosmetic > changes to the code: moving a function definition from the > .cpp to the .h, moving a function declaration in the .h, > etc., seems to work for individual errors. But whenever I > add a new module they come back again, twice as plentiful. > > I thought it might be STL and vectors, but changing my > container implementation to use arrays didn't help. So it's > not, as I thought, STL's fault. It might be a link order No relation to STL. > problem, so I used the Make Makefile function and tried to do > things from the command line. However, I can't get make to > work with the > Dev-C++'s makefiles: it gives me errors like '**18: Multiple > targets.' And Dev-C++'s Project Options only asks for > -additional- arguments to pass to the linker. > So I'm really getting demoralized. This problem has held > me up for three days now. I'd very much appreciate some assistance. > > It has been suggested I provide a code fragment, but since > the errors seem to be independent of legality of the code, > and only crop up when the projects gets big, I don't see how > it would help. However, I will provide such a thing if asked, > though I really have no idea what could be relevant to the problem. > > --Devin Carless Either there is no such thing in the library you use or if the construct is yours you have not provided a definition. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |