ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using ns2.35.
There are some functions in god.cc files which i want to use in my tcl script.
I dont know how to call these functions or how to link them in tcl file.
Please suggest any idea for calling these functions from tcl file.
Thanks
Thanks sir for trying to help.
But it is something different.
In ur advised link it is about some back end processing of c functions.
I want to call the functions which are already defined in god.cc file.
Let's start at the beginning. You have a file called 'god.cc'. Considering the
extension I'll assume it to be a piece of C++ source. To use it from Tcl you'll
need to a) compile it, and b) tell Tcl about the newly compiled object/library
files existence. The 2nd link I provided does exactly that (I think).
What is your problem?
Cheers,
Tink
P.S.: This is more suitable in PROGRAMMING, so I'm moving it over there.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
The most used way to use a new "god.cc" in ns2
is to compile the stuff into the binary 'ns'.
Add god.o to the Makefile.in, section OBJ_CC.
Reconfigure to get a new Makefile, and run 'make'.
( god.o can also be added to the Makefile.
Then just run 'make'.)
It is a good idea to save a copy of the original 'ns' as ns-orig.
The new ns may not be usable with the most default tcl scripts.
Hi
I m not changing god.cc file.
The functionality that i want is already there.
I want to find whether two nodes are neighbor or not.
A function named isNeighbor is there in god.cc.
But how to call this function from my tcl script is the problem.
I hope problem is explained now.
Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.