I have a project with multiple file as below:
//header.h
class example {...}
//variable.h
#include "header.h"
example ex;
//main.cpp
#include "variable.h"
....
//src1.cpp
#include "variable.h"
when compiling the compiler error as: multiple definition of "ex" I dont understand why, I want to use "ex" in main.cpp and src1.cpp, how should I do. Thanks,