Example: TclODBC is an extension written in C++.You can evaluate Tcl scripts, call Tcl functions and write new Tcl commands in C++ just like in C. The Tcl headers are safe for direct use in C++. The only gotcha for extension writers is that the init functions must be declared 'extern "C"' so that the compiler leaves their names alone for the load command.Also with command-line compilers (like GCC) be sure to use the C++ compiler frontend (like g++) for linking so that you pick up the C++ runtime support automatically.Obviously everybody that interfaces with Tcl from C++ encapsulates some of the Tcl objects in corresponding C++ classes. BR doesn't know of any effort yet to provide standard all-purpose C++ wrapper classes for this.
willdye (2004-12-27) In practice, I usually wind up just using some variant of Tcl_Eval(), but I'm constrained by coding standards already in place at my job. If I were starting from scratch, I'd do well to start by searching this wiki for references including, but not limited to:cpptcl, Invoking Tcl commands from Cplusplus, Critcl does C++, Critcl, Cplusplus streams and Tcl channels, Swig, C++, and Why adding Tcl calls to a C/C++ application is a bad idea.Regarding cpptcl, these links outside the wiki may also be of interest:http://cpptk.sourceforge.net


Instigate Scripting Library
