Quote Originally Posted by Russco View Post
In one cpp file define the variable, in all other translation units that need the variable declare as extern.
Russco is right. The error is not because of multiple inclusion but cause the global variable was DEFINED in the header so that each cpp that includes the header would create a new instance of that variable (symbol). The linker then will complain because of that.

So, in the header you would need only a DECLARATION what is made by the extern keyword. And one and only cpp MUST have a definition of the variable simply like

Code:
// header
...
extern char test[MAX_PATH];
...

// first.cpp 
#include "header.h"

char test[MAX_PATH] = "file.txt";
You see the use of shared global variables among source files is quite tricky. You better use a class and define a static public member.

Code:
// global.h
#ifndef GLOBAL_H
#define GLOBAL_H

class Global
{
public:
    static char * getTest()
    {
           static char test[MAX_PATH] = "file.txt";
           return test;
    }
};
#endif

// any cpp 
#include "global.h"
...
    // set another file
    strcpy(Global::getTest(), "anotherfile.txt");

    // use filename
    ifstream ifs(Global::getTest());
Beside of using plain char pointers the above is much easier and a C++ solution. And the char pointer easily could be replaced by a std::string.