Hi Gayathri,
First of all, in NS2 (in linux), the extension of C++ file is ".cc" not ".c++". So you have to change that first. Secondly, if you would like to incorporate new NS2 modules (i.e., files .cc, .h, .tcl). Please see http://www.ns2ultimate.com/post/454001969/including-new-modules-into-ns-2 I hope it'll help. Best Regards, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear http://www.t-issariyakul.blogspot.com http://www.ece.ubc.ca/~teerawat On 3/15/2010, "gayathri devi" <k.gayathrid...@yahoo.co.in> wrote: > >Hai Everybody, > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â For linking the c++ code with otcl >script, I have included the C++ code and it's object file under the ns2 >directory and used make command to re-compile it for the changes >included. But it is producing the following errors ... So, Kindly >suggest me some guidelines regarding this .... > > >[r...@localhost ns-2.34]# g++ -c greedy4.c++ >linkage.tcl:1: error: âsetâ does not name a type >agent.h:37: error: expected class-name before â{â token >greedy4.c++:35: error: extra qualification âGreedyBound::â on member >âreadmatrixâ >greedy4.c++:35: error: âvoid GreedyBound::readmatrix()â cannot be >overloaded >greedy4.c++:21: error: with âvoid GreedyBound::readmatrix()â >greedy4.c++:56: error: > extra qualification âGreedyBound::â on member âdistanceâ >greedy4.c++:56: error: âvoid GreedyBound::distance()â cannot be overloaded >greedy4.c++:19: error: with âvoid GreedyBound::distance()â >greedy4.c++:69: error: extra qualification âGreedyBound::â on member >âgreedyâ >greedy4.c++:69: error: âvoid GreedyBound::greedy(int)â cannot be overloaded >greedy4.c++:20: error: with âvoid GreedyBound::greedy(int)â >greedy4.c++:108: error: extra qualification âGreedyBound::â on member >âfindangleâ >greedy4.c++:108: error: âvoid GreedyBound::findangle(double, double, >double)â cannot be overloaded >greedy4.c++:23: error: with âvoid GreedyBound::findangle(double, double, >double)â >greedy4.c++:159: error: extra qualification âGreedyBound::â on member >âdisplayâ >greedy4.c++:159: error: âvoid GreedyBound::display(int)â cannot be >overloaded >greedy4.c++:22: error: with âvoid > GreedyBound::display(int)â >greedy4.c++:184: error: expected class-name before â{â token >greedy4.c++:192: error: cannot define member function >âGreedyBound::BsrAgent::BsrAgentâ within âGreedyBoundâ >greedy4.c++:201: error: cannot define member function >âGreedyBound::BsrAgent::commandâ within âGreedyBoundâ >greedy4.c++:210: error: cannot define member function >âGreedyBound::BsrAgent::MyprivateFuncâ within âGreedyBoundâ >greedy4.c++:216: error: expected `}' at end of input >greedy4.c++: In member function âvoid GreedyBound::readmatrix()â: >greedy4.c++:37: error: âTclâ was not declared in this scope >greedy4.c++:37: error: âtclâ was not declared in this scope >greedy4.c++:37: error: âTclâ is not a class or namespace >greedy4.c++: In member function âvoid GreedyBound::distance()â: >greedy4.c++:60: error: âTclâ was not declared in this scope >greedy4.c++:60: error: âtclâ was > not declared in this scope >greedy4.c++:60: error: âTclâ is not a class or namespace >greedy4.c++: In member function âvoid GreedyBound::greedy(int)â: >greedy4.c++:72: error: âTclâ was not declared in this scope >greedy4.c++:72: error: âtclâ was not declared in this scope >greedy4.c++:72: error: âTclâ is not a class or namespace >greedy4.c++:74: error: no matching function for call to >âGreedyBound::GreedyBound()â >greedy4.c++:11: note: candidates are: GreedyBound::GreedyBound(const >GreedyBound&) >greedy4.c++: In member function âvoid GreedyBound::findangle(double, double, >double)â: >greedy4.c++:111: error: âTclâ was not declared in this scope >greedy4.c++:111: error: âtclâ was not declared in this scope >greedy4.c++:111: error: âTclâ is not a class or namespace >greedy4.c++: In member function âvoid GreedyBound::display(int)â: >greedy4.c++:161: error: âTclâ was not declared in > this scope >greedy4.c++:161: error: âtclâ was not declared in this scope >greedy4.c++:161: error: âTclâ is not a class or namespace >greedy4.c++: In constructor âGreedyBound::BsrAgentClass::BsrAgentClass()â: >greedy4.c++:186: error: class âGreedyBound::BsrAgentClassâ does not have >any field named âTclClassâ >greedy4.c++: In static member function âstatic TclObject* >GreedyBound::BsrAgentClass::create(int, const char* const*)â: >greedy4.c++:188: error: cannot convert âGreedyBound::BsrAgent*â to >âTclObject*â in return >greedy4.c++: At global scope: >greedy4.c++:189: error: expected unqualified-id at end of input >[r...@localhost ns-2.34] > > >Thanking You, >Gayathri > > > Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! > http://downloads.yahoo.com/in/internetexplorer/