problem adding routing protocol

82 views
Skip to first unread message

res

unread,
Dec 27, 2008, 1:53:52 AM12/27/08
to ns-3-users
Hi,

Just to see how a routing protocol can be added onto NS3, I've just
tried with an example protocol --'newr' .

I've put newr in /src/routing , created helper files in /src/helper ,
and modified /src/wscript.

simple-point-to-point-newr.cc is in /scratch.

Here goes the error

[root@localhost ns-3.2]# ./waf
Entering directory `/usr/local/ns-3.2/build'
[483/550] cxx: scratch/simple-point-to-point-newr.cc -> build/debug/
scratch/simple-point-to-point-newr_6.o
../scratch/simple-point-to-point-newr.cc: In function ‘int main(int,
char**)’:
../scratch/simple-point-to-point-newr.cc:84: error: ‘NewrHelper’ was
not declared in this scope
../scratch/simple-point-to-point-newr.cc:84: error: expected `;'
before ‘newr’
../scratch/simple-point-to-point-newr.cc:85: error: ‘newr’ was not
declared in this scope
../scratch/simple-point-to-point-newr.cc: At global scope:
../scratch/simple-point-to-point-newr.cc:148: error: redefinition of
‘ns3::LogComponent g_log’
../scratch/simple-point-to-point-newr.cc:14: error: ‘ns3::LogComponent
g_log’ previously declared here
../scratch/simple-point-to-point-newr.cc: In function ‘int main(int,
char**)’:
../scratch/simple-point-to-point-newr.cc:151: error: redefinition of
‘int main(int, char**)’
../scratch/simple-point-to-point-newr.cc:17: error: ‘int main(int,
char**)’ previously defined here
../scratch/simple-point-to-point-newr.cc:218: error: ‘NewrHelper’ was
not declared in this scope
../scratch/simple-point-to-point-newr.cc:218: error: expected `;'
before ‘newr’
../scratch/simple-point-to-point-newr.cc:219: error: ‘newr’ was not
declared in this scope
../scratch/simple-point-to-point-newr.cc: At global scope:
../scratch/simple-point-to-point-newr.cc:282: error: redefinition of
‘ns3::LogComponent g_log’
../scratch/simple-point-to-point-newr.cc:14: error: ‘ns3::LogComponent
g_log’ previously declared here
../scratch/simple-point-to-point-newr.cc: In function ‘int main(int,
char**)’:
../scratch/simple-point-to-point-newr.cc:285: error: redefinition of
‘int main(int, char**)’
../scratch/simple-point-to-point-newr.cc:151: error: ‘int main(int,
char**)’ previously defined here
../scratch/simple-point-to-point-newr.cc:285: error: redefinition of
‘int main(int, char**)’
../scratch/simple-point-to-point-newr.cc:17: error: ‘int main(int,
char**)’ previously defined here
../scratch/simple-point-to-point-newr.cc:352: error: ‘NewrHelper’ was
not declared in this scope
../scratch/simple-point-to-point-newr.cc:352: error: expected `;'
before ‘newr’
../scratch/simple-point-to-point-newr.cc:353: error: ‘newr’ was not
declared in this scope
Build failed
-> task failed (err #129): [bld:///usr/local/ns-3.2/scratch/simple-
point-to-point-newr_6.o]


Is there any other modification that I have to make?

Please help if possible.

Tom Henderson

unread,
Dec 27, 2008, 12:47:38 PM12/27/08
to ns-3-...@googlegroups.com
res wrote:

>
> Is there any other modification that I have to make?

For starters, these lines suggest that your new header files are not
being included.

> ../scratch/simple-point-to-point-newr.cc:84: error: ‘NewrHelper’ was
> not declared in this scope
> ../scratch/simple-point-to-point-newr.cc:84: error: expected `;'
> before ‘newr’

If your simple-point-to-point-newr.cc already includes
"ns3/helper-module.h", then you need to add your new helper header file
to src/helper/wscript. Or else, you can just directly include your new
header files at the top of your simple-point-to-point-newr.cc file.

Tom

bcraw...@gmail.com

unread,
Dec 27, 2008, 7:31:41 PM12/27/08
to ns-3-...@googlegroups.com
I can't tell the error -- seems like the kind of thing you might just have to bang your head against till you get it....
 don't you also need to modify wscript in the helper folder  include your new file?

res

unread,
Dec 29, 2008, 4:18:26 AM12/29/08
to ns-3-users
After adding the helper file to src/helper/wscript, it worked fine.
Thanks!!!!
Reply all
Reply to author
Forward
0 new messages