1>stdafx.obj : error LNK2005: "void __cdecl MapRefresh(void)" (?MapRefresh@@YAXXZ) already defined in Program.obj
1>stdafx.obj : error LNK2005: "char (* Map)[11]" (?Map@@3PAY0L@DA) already defined in Program.obj
1>C:\Documents and Settings\CPlusPlus\my documents\visual studio 2010\Projects\Program\Debug\Program.exe : fatal error LNK1169: one or more multiply defined symbols found
This happened when I tried to create a function in a header file instead of putting it into the main .cpp file. The code for the header is
There is nothing else that relates the two files. I included the header file to stdafx.h(The file where I include all of my headers), then included that one to the .cpp. Yes I used "" and not <>.
Default comes with a VSE project. Why woul- Oh, thanks! What problem would having that cause? I never really delete it, I know it would clean things up, but I didn't think it would cause errors.
The compiler will make an object code file (.obj) for every .cpp file in your project. Since your header doesn't seem to have an include guard, it can be #included more than once, which causes multiple definitions problems.
SOME_UNIQUE_SYMBOL can be anything, as long as it's guaranteed to be unique throughout the entire program. Typically it's something like HEADER_FILE_NAME_H or HEADER_FILE_NAME_INCLUDED.