I have a similar scenario as described below:
I have one header file first.h It has a function:
char* getName();
and the associated cpp first.cpp file with the function definition
char* getName(){return "first";}
and the second header file second.h it has a function:
char* getName();
associated cpp second.cpp file with function definition
char* getName(){return "second";}
Now there is a main() function:
#include "first.h" #include "second.h" int main(){ return 0; }
when I include these .h files, the compiler gives an error in the getName() function because it conflicts.
How to get rid of this problem without changing .h files
source share