Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-11-2011, 07:01 AM   #1
Registered: Feb 2011
Posts: 47

Rep: Reputation: 1
how to link tcl file and C++ files together and run in ns2?


if i have a tcl file and c++ file, how can i compile them n run them in ns2?

anyone please help?urgent.
Old 02-11-2011, 11:31 AM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,381

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Tcl is a scripting language. No compiling. Files are run by an interpreter,
in ns2 the binary 'ns' is used : 'ns file.tcl'

The usual method is to add the new object to a copy of the 'Makefile'.
Example abcd.cpp : Then add abcd.o to "", section "OBJ_CC =".
( Assume a backup for Makefile ( like ) and ns
( Rename ns to e.g. ns233 )).

Next : make clean && make -f .
Like the example, you already know :

Another example :
Please look for "Installation".

Old 12-19-2011, 12:26 AM   #3
LQ Newbie
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
how to link tcl file and C++ files together and run in ns2?

Hello Knudfl..
i am Ama and i m very new to this group and ns2 in general. I have a c++ script from crypto++. It runs well. Now, i would want to call this .cpp file in an ns-2 tcl file. I read your reply to a similar question but cant really get it. can u please explain further and in a way that a new person like me can understand. Especially with the Makefile aspect.
Thanks in advance...
Old 07-25-2012, 03:42 PM   #4
LQ Newbie
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
c tcl linkage

Hi everyone!

how can i get a variable's value in c from tcl, i've already tried binding in vain!
i want to pass a value from one agent to another gotta get that value in tcl and then send it to the
other agent.
it'll help too if u tell me out to get a header's field's value from an agent in tcl.

pls help me out thanks.


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
script tcl NS2 MounaRM Linux - Networking 0 01-10-2011 08:49 AM
where to place my tcl scripts for ns2 to see them ? alinnic1 Linux - Software 2 10-14-2010 10:58 AM
Attaching an algorithm to tcl script in ns2 raviteja99 Linux - Wireless Networking 2 09-12-2010 07:16 PM
URGENT- Having problems with tcl,ns2 in cygwin ritoban87 Linux - Newbie 2 01-22-2010 07:07 AM
Can't install NS2 on FC4 - Tcl make eror skyeman Linux - Software 1 08-24-2005 03:17 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:36 PM.

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