LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2014, 08:09 AM   #1
Zahraa Ayad
LQ Newbie
 
Registered: Dec 2014
Posts: 19

Rep: Reputation: Disabled
Post 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?
 
Old 12-18-2014, 12:48 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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/

----
 
1 members found this post helpful.
Old 12-19-2014, 04:06 AM   #3
Zahraa Ayad
LQ Newbie
 
Registered: Dec 2014
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thank u so much ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
olsr.tcl with ns2.35 Suhaila Linux - Software 6 03-10-2014 11:16 AM
NS2 tcl scripting kumar_s Linux - Wireless Networking 1 01-13-2014 12:05 AM
NS2, need TCL code chilamanda Linux - Software 2 10-03-2013 03:10 PM
vlan.tcl in ns2 aditi.sen Linux - Networking 1 03-21-2013 03:35 AM
script tcl NS2 MounaRM Linux - Networking 0 01-10-2011 08:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration