Problem with compiler Dev-cpp 4.9.9.2

My program started off fine, then after a few error (of mine) it obviously shows something wrong, but then my compiler stated complaining about things that don't exist, or at least things that shouldn't be a problem.

For example I have a class with appropriate header and source files. The header contains an #ifndef macro and the appropriate class declaration and definition with any additional macros needed for any includes that class may need. The source code has an include to the header (just in case) and the definitions for all the functions declared as part of the class in the header.

On compiling I get errors that few functions in the class have been "used but never defined" when they have. Everything is perfect in the code but it wont compile, then remove the statement in main.cpp which includes this class and add it back again (or do something pointless similar to this which i can't quite remember) and it compiles fine.

I also have a problem that says another class is being defined repeatedly when this is also definitely not happening (but I feel like I've gone into enough detail with the first error, I don't want to rant too much)...

Does anybody else have this kind of problem in DevC++ and/or know how to fix them?
On compiling I get errors that few functions in the class have been "used but never defined" when they have.


Is this a linker error?

Sounds like the cpp file for your class is not part of your project. Simply having the file open in the IDE is not enough. DevC++ needs to know that the source file contains code to be built into your program. You tell it this by adding the file to the project.

I don't know how this is done in DevC++, but I'm sure it's pretty straight forward (look in the File or Projects menus for an option that looks right).

I also have a problem that says another class is being defined repeatedly when this is also definitely not happening


Are you doing something weird like #including cpp files or something? Hard to diagnose this one without more detail and/or code.



In the future, the exact error messages would really help. Paraphrasing the error means we have to guess as to what the error actually is.
Yes of course, I'll upload relevant source code and error messages as soon as I can (not on very good internet at minute).
I can tell you that the files are included in the ".dev" project, whether this is the same as what you mention above I'm not quite certain, I'll check.
Topic archived. No new replies allowed.