#include <tcl.h> ... #if (TK_MAJOR_VERSION < 8) #define Tk_SafeInit ((Tcl_PackageInitProc *) NULL) #endifWhy? Now your code can safely include the initialization sequence:
if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);without worrying about what versions of Tk do and do not define Tk_SafeInit().