LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linking C++ to TCL in ns2 (https://www.linuxquestions.org/questions/programming-9/linking-c-to-tcl-in-ns2-4175528656/)

Zahraa Ayad 12-18-2014 08:09 AM

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:

knudfl 12-18-2014 12:48 PM

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/

----

Zahraa Ayad 12-19-2014 04:06 AM

Thank u so much ...


All times are GMT -5. The time now is 03:02 AM.