I am having 2 header (.hh) files and there are some functions defined and implemented in both of these files:
What I want it so call a function of the other header file (let's call it B) from an implementation in header file A.
Here is what I have:
//headerA.hh LSQUnit<Impl>::read(...args....) ... callfunction(...args...); } where the implementation of call function is in the other header file like this:
// headerB.hh template<class Impl> inline void BaseDynInst<Impl>::callfunction (...args...){ .... } I have added in my headerA.hh these:
#include "headerB.hh" .... void call function (...args...) but I get undefined reference to callfunction in my headerA.hh
I have also tried these:
when I call it from headerA.hh
callfunction<BaseDynInst> callfunction (...args...) or add this impleentation of this in my headerB.hh:
LSQUnit<Impl>::callfunction(...args...) but they gave me more errors.
I know that putting implementations inside .hh may not be ideal but I am using a simulator which is not created by me, so I cannot change that because it will make things worse.
Is it possible what I want or the only solution is to implement the function inside headerA.hh ? I want to avoid that because it calls many others that all exist in headerB.hh?