File1.h
// Declaration
Class A
{
void Func();
}
//Along with some other stuff
File1.cpp
//Definition
A::Func()
{
}
// Along with some other stuff
File2.h
class A
{
void Func();
}
File2.cpp
// Definition
File2::A::Func()
{
}
File3.cpp
#include "File1.h"
#include "File2.h"
//
Invokes Func()
Main1.cpp Main2.cpp
Main1.cpp File3.cpp and File2.cpp are build together
Main1.cpp File3.cpp and File1.cpp are build together
I want to invoke Func() depending different linkage
But, it gives me compile time error.
How should I get around compile time error?
Is there standard way to get around above problem?
If I use namespace for File1 and File2 then I will not be able to invoke dynamically. Note: I can not change File1.h