--- cpptcl.cc So Feb 8 23:14:34 2009 +++ cpptcl.cc So Feb 8 23:13:07 2009 @@ -320,7 +320,7 @@ post_process_policies(interp, pol, objv, false); } - catch (exception const &e) + catch (std::exception const &e) { Tcl_SetResult(interp, const_cast(e.what()), TCL_VOLATILE); return TCL_ERROR; @@ -363,7 +363,7 @@ post_process_policies(interp, pol, objv, true); } - catch (exception const &e) + catch (std::exception const &e) { Tcl_SetResult(interp, const_cast(e.what()), TCL_VOLATILE); return TCL_ERROR; @@ -430,7 +430,7 @@ Tcl_GetString(Tcl_GetObjResult(interp)), object_handler, static_cast(chb), 0); } - catch (exception const &e) + catch (std::exception const &e) { Tcl_SetResult(interp, const_cast(e.what()), TCL_VOLATILE); return TCL_ERROR; @@ -858,6 +858,18 @@ owner_ = true; } +interpreter::interpreter(string const &libpath) +{ + interp_ = Tcl_CreateInterp(); + owner_ = true; + + try + { + this->eval("set tcl_library \"" + libpath + "\""); + Tcl_Init(this->interp_); + } catch (...) {} +} + interpreter::interpreter(Tcl_Interp *interp, bool owner) { interp_ = interp; --- cpptcl.h Wed Jan 28 20:56:11 2009 +++ cpptcl.h Sat Jan 24 12:52:54 2009 @@ -467,6 +467,7 @@ { public: interpreter(); + interpreter(std::string const &libpath); interpreter(Tcl_Interp *, bool owner = true); ~interpreter();