Hi everyone,
I've recently been having linker problems when compiling projects with classes. The linker (GNU's LD i believe) delcares that member functions have been defined multiple times, and I cannot see any apparent reason for this.
To test the problem, I created a small project with a single basic class, with the declaration and definition in separate ".h" and ".cpp" files respectively. I've coded for the whole "#ifndef" thing in both files. The main() function simply creates an instance of the object, performs a few functions, and outputs a result. However, on compilation of the project, the linker tells me that I have multiple definitions of all my member functions. I've had this happen with other projects with classes in as well. The really weird thing is that when i compile it with g++ from the command line, the project compiles successfully and everything works fine.
I've tried LD's option to allow multiple definitions but this didn't work for some reason. I will post source code here ASAP, but at the moment I'm away from my home computer so you will have to bear with me. Oh and I'm running this all on Win XP Pro SP3 if that's worth anything.
Any ideas on what I need to do to get this to work?