I have two headers with source files, lets say file1.h
, file1.cc
and file2.h
, file2.cc
. They use each others functions, for example:
file1.h:
void test1();
file2.h:
void test2();
file1.cc:
#include "file1.h"
#include "file2.h"
void test1() {
do_something();
test2();
}
file2.cc:
#include "file1.h"
#include "file2.h"
void test2() {
do_something_else();
test1();
}
I get the problem, the dependancy is mutual and we cant compile one file without having another compiled. How to solve this problem?