[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Similar problems with changing the c++ class



Hello Everyone:

I tried to add a function in agent.cc.
I added the following into the agent.h file:

public:
	void MyTest();

I added the following into the agent.cc file:

if (argc == 2){
....
   if (strcmp(argv[1], "call-test") == 0) {
	MyTest();
	return(TCL_OK);
   }
....
void
Agent::MyTest()
{
}

I write my tcl script like the following:
set t0 [new Agent]
$t0 call-test

I recompiled ns successfully. But when I run the tcl 
I met the following error:

    (_o3 cmd line 1)
    invoked from within
"_o3 cmd call-test"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o3" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$t0 call-test
"
    (file "Test.tcl" line 2)

I think this problem is related to the previous one.
Do I forget to modify anything?

Any suggestion is warmly welcomed.
Thank you.
Dan.

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com