In a header file of your C/C++ application or extension that includes the Tk library, add these lines: #include ... #if (TCL_MAJOR_VERSION < 8) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel, int, ClientData*)); #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif All that TCL_STORAGE_CLASS monkey business is to make sure all compilers understand that your code, not the Tcl library, will be providing the Tcl_GetChannelHandle() function. Somewhere in your program/library code, add these lines: #if (TCL_MAJOR_VERSION < 8) int Tcl_GetChannelHandle(Tcl_Channel channel, int dir, ClientData *handlePtr) { Tcl_File tfile=Tcl_GetChannelFile(channel,dir); if(tfile==NULL) return TCL_ERROR; *handlePtr=Tcl_GetFileInfo(tfile,NULL); return TCL_OK; } #endif There! Now you can call Tcl_GetChannelHandle() even if you happen to link against a Tcl 7 library.