カスタム Tcl インタープリターを TclDevKit のプレフィックス ファイルとして使用したいと考えていますtclapp。
次のファイルから構築された TCL インタープリターがあります。
// file main.cpp
#include <tcl.h>
int
Tcl_AppInit( Tcl_Interp* interp )
{
if ( Tcl_Init( interp ) == TCL_ERROR ) {
return TCL_ERROR;
}
if ( Tcl_Eval( interp, "puts \"this is my interpreter\"" ) == TCL_ERROR ) {
return TCL_ERROR;
}
return TCL_OK;
}
int
main( int argc, char** argv )
{
Tcl_Main( argc, argv, &Tcl_AppInit );
return 0;
}
main.cpp次のコマンドでビルドします。
g++ -Wl,-R/usr/local/lib -L/usr/local/lib -ltcl main.cpp -o myinterp
と通訳を取得しmyinterpます。
TclDevKit のオプションとして渡すことができるようにするには、上記main.cppのg++コマンドをどのように変更すればよいですか?myinterp-prefixtclapp