Linking C++ to TCL in ns2
I am using ns2.34 simulator, and i have a project in Wireless Sensor Networks. i want to know how to write an algorithm in C++ and then linking it to TCL configuration file?:study:
|
Welcome to LQ.
The default functions : They are all compiled into the executable 'ns'. That includes the c++ functions, and files in ns-2.34/tcl/lib/ , etc. tcl/<folders>. So normally you would add a new function to e.g. : tcl/{ ns-default.tcl, ns-lib.tcl, ns-mobilenode.tcl, ns-packet.tcl }. ... And compile everything new into a new "ns-new". I.e. make a backup of the current 'ns' : $ cp ns ns-orig Then : $ make clean && make ---- There are ways of using c++ in tcl : ( I have never seen anybody using it in ns2 ) http://www.linuxquestions.org/questi...9/#post4094259 < http://www.linuxquestions.org/questi...ines-813129/#7 http://wiki.tcl.tk/1491 C++ http://cpptcl.sourceforge.net/doc/quickstart.html http://wiki.tcl.tk/13040 http://cpptcl.sourceforge.net/ ---- |
Thank u so much ...
|
All times are GMT -5. The time now is 03:02 AM. |