[Dev-C++] Newbie linking errors: 'undefined reference'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Devin C. <dcc...@ya...> - 2002-02-09 19:44:17
|
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$11WomanQSBook+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 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 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 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |