LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-16-2010, 01:52 AM   #1
rajesh_ds2@yahoo.co.in
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Rep: Reputation: 0
split programming in ns2 marc greis chapter 7 ping protocol code


sir/madam
i tried compiling the above program and got the errors as in error.txt i have attached. Ping.cc and ping.h also are attached.
I have supplied all the required header files along with appropriate paths and yet this problem. Please may i know the solution for this. Thankyou
Rajesh


ATTACH]5537[/ATTACH]

pingcc.txt

pingh.txt
Attached Files
File Type: txt error.txt (18.7 KB, 21 views)
 
Old 12-16-2010, 04:44 AM   #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.

I don't think ping.cc was meant for a standalone compiling.
'g++ ping.cc' will show all the missing headers : common/agent.h etc.
common/agent.h includes other headers, that has e.g. #include "lib/bsd-list.h".
All this is a job for a Makefile.
( I assume, you mean ping.cc, and not p.cc (Ref. your error.txt.))

Chapter VII.2 ( = 7.2 ) ( All this was written 10 years ago.)
http://www.isi.edu/nsnam/ns/tutorial/nsnew.html
QUOTE : "But first of all, some other files have to be edited
before ns can be recompiled."

I.e. : Usually a new protocol is compiled into the binary 'ns'.

The old 'ping.cc' is dated year 2000, and may not fit into a recent ns-2.xx.


P.S. : Default location for ns2 is /home/<name>/ns2 or similar.
Then all commands can be done as 'unprivileged user'.
"/root/" is not the place. /root/ is not meant to be used for anything.

PPS. : ping.cc is included in all ns2 since 2001:
find ns2/ -name ping.cc
ns-allinone-2.1b9a/ns-2.1b9a/apps/ping.cc
ns-allinone-2.27/ns-2.27/apps/ping.cc
ns-allinone-2.27/ns-2.27/ns-tutorial/examples/ping.cc
ns-allinone-2.31/ns-2.31/apps/ping.cc
ns-allinone-2.33/ns-2.33/apps/ping.cc
ns-allinone-2.34/ns-2.34/apps/ping.cc
ns-allinone-2.35-RC6/ns-2.35/apps/ping.cc
..

Last edited by knudfl; 12-16-2010 at 08:09 AM.
 
1 members found this post helpful.
Old 12-22-2010, 05:06 AM   #3
rajesh_ds2@yahoo.co.in
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Original Poster
Rep: Reputation: 0
thank you sir/madam
I was trying to compile Jae Young's "ns by example" programme " ex-linkage.cc " .
My problem got solved as far compiling is considered by linux forum QA . I compiled and did the changes to " Makefile " .
I then ran command "make" . Everything went fine .
But when i execute "ns ex-linkage.tcl" it says "invalid command name ?agent/MyAgent/Otcl "
What is the solution for this sir/madam
 
Old 12-22-2010, 07:54 AM   #4
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
Post #3 :
The answer is in your thread from today about the same issue.

http://www.linuxquestions.org/questi...xample-851790/

Please do not double post. http://www.linuxquestions.org/linux/rules.html

http://www.linuxquestions.org/linux/...Ask_a_Question

..
 
  


Reply



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
LEACH protocol installation on NS2.27 Scofield Linux - General 255 03-08-2012 05:19 PM
installing a new protocol in ns2.34 MounaRM Linux - Networking 1 11-26-2010 07:45 AM
error when running wireless1 and 2 in Marc Greis tutorial alinnic1 Linux - General 0 10-22-2010 11:54 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 03:39 AM

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

All times are GMT -5. The time now is 12:45 PM.

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