When I create the source, it throws an error: declaration of 'globalMemTrace' has a different language linkage
#ifdef MEMDEBUG_SIMULATIONS
#include "mem-trace.h"
MemTrace *globalMemTrace;
#endif
int Tcl_AppInit(Tcl_Interp *interp)
{
#ifdef MEMDEBUG_SIMULATIONS
extern MemTrace *globalMemTrace;
globalMemTrace = new MemTrace;
#endif
}
I searched Google several times. Some said that it was due to an error, if clangsome of the tricks mentioned when used externin different ways can solve it.
But since I am not such a profession, I tried some of them and could not solve it. Is there a good way to handle this?
It is written in C ++, and the problem occurs when extern MemTrace *globalMemTrace;
source
share