Index: tcc4tcl.c ================================================================== --- tcc4tcl.c +++ tcc4tcl.c @@ -286,11 +286,15 @@ if (s == NULL) { return(TCL_ERROR); } #ifdef USE_TCL_STUBS - tcc_add_symbol(s, "tclStubsPtr", &tclStubsPtr); + if (index == 0) { + /* Only add this symbol if we are compiling to memory */ + tcc_add_symbol(s, "tclStubsPtr", &tclStubsPtr); + } + tcc_define_symbol(s, "USE_TCL_STUBS", "1"); #endif tcc_set_error_func(s, interp, (void *)&Tcc4tclErrorFunc);