I know this error has been published many times but I couldn't find a solution to mine.
I have 4 files:
def.h
mms.h
mms.cpp
runMms.cpp
In the first one I define a struct. In the second I declare/create a new class called mms and I include "def.h". The third one is the cpp file of the class and I include in it "mms.h" (no, I don't include in it "def.h"). The fourth and last has the 'main' and I include in it "mms.h"
For some reason I'm getting the "error: lnk2005 alread defined ..." I know it usually has to do with putting some header file or definitions twice but I can't see where I got wrong.
I would appreciate it if any helprs could attached a code sample or something like that.
Another problem might be that you have a function body fully defined in a header (which will be a problem unless the function is a template or is inlined).
Or.. another problem might be that you have a variable declared in a header.
It's impossible to be more specific without actually seeing the error message in full. The error message will actually tell you exactly what symbol is being multiply defined... so it helps to read/post it.