I have a variable const char * FILENAME = "a/file/name"
defined in two .cpp files, called a.cpp
and b.cpp
. Nothing includes these files directly, and they only include a.h
and b.h
respectively into themselves. Both of those header files are then included in main.cpp
My problem is that I'm getting the following linker error:
a.obj : error LNK2005: "char const * const FILENAME" (?FILENAME@@3PBDB) already defined in b.obj
I don't use file scope variables very often, so I thought this would be okay... What am I doing wrong here?