[ns] Problem in binding a C++ and Tcl variable

Nikhil Punnoose nikhilgp at gmail.com
Tue Jul 14 06:46:46 PDT 2009


I realize that this is likely to be a rather basic error on my part, so I
was hoping someone could clear it up for me.


I get the following error when I try to set a new variable into an existing
agent using the tcl script. I attempted to do this by putting
    bind("lr",&lr);
in the constructor for the class in which I want to use the variable lr.

/bin/sh: ../tclcl-1.18/tcl2c++: not found
error writing "stdout": broken pipe
    while executing
"puts $line"
    (procedure "expand_file" line 18)
    invoked from within
"expand_file [lindex $L 1]"
    (procedure "expand_file" line 16)
    invoked from within
"expand_file [file tail $name]"
    ("foreach" body line 5)
    invoked from within
"foreach name $argv {
    set dirname [file dirname $name]
    if {$dirname != "."} {
        cd $dirname
        expand_file [file tail $name]
        cd $startupDir
    } else ..."
    (file "bin/tcl-expand.tcl" line 65)
make: *** [gen/ns_tcl.cc] Error 127


Here is the code that i added in the tcl script:

Session/RTP instproc  link-rate { bspec } {
    set b [bw_parse $bspec]
    $self lr $b

}

I thought this would be enough to pass the link-rate over to the variable
lr.

and an additional "    $self set lr 0" in the init constructor for the
Session/RTP class

Thanking you,
Nikhil George Punnoose
EE06B071
Department of Electrical Engineering
IIT Madras


More information about the Ns-users mailing list