Errors during installation of NS-2.29 in Fedora 15

When I was installing ns-2.29 in fedora for the purpose of working on sensor networks I faced many errors. This post explains how to overcome these errors. Mannasim simulator is used for simulating sensor networks. It is available for ns-2.29 at http://www.mannasim.dcc.ufmg.br/

Error 1

Tcl.cc: In member function ‘void Tcl::eval(char*)’:

Tcl.cc:182:8: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc: In member function ‘int TclObject::traceVar(const char*, TclObject*)’:

Tcl.cc:421:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc: In static member function ‘static int TclClass::create_shadow(ClientData, Tcl_Interp*, int, const char**)’:

Tcl.cc:509:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc:511:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(ClientData, Tcl_Interp*, int, const char**)’:

Tcl.cc:566:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

Tcl.cc:571:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc: In member function ‘virtual void TclClass::bind()’:

Tcl.cc:603:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Tcl.cc:605:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [Tcl.o] Error 1

tclcl-1.17 make failed! Exiting …

sol:

go to /ns-allinone-2.29/tclcl-1.17

open file tcl.cc

Replace the following

if (need_parse) {

char *p = strchr(localName, ‘(‘);

if (p)

*p = 0;

};

with

if (need_parse) {

const char *p = strchr (localName, ‘(‘);

if (p)

((char*) localName)[p-localName] = ‘\0’;

};

Error 2

./sctp/sctp.h:577:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]

./sctp/sctp.h:705:8: error: extra qualification ‘SctpAgent::’ on member ‘DumpSendBuffer’ [-fpermissive]

trace/trace.cc:185:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [trace/trace.o] Error 1

Ns make failed!

Sol:

/ns-allinone-2.29/ns-2.29/sctp

open sctp.h

/* debugging functions

*/

Replace line 705

void SctpAgent::DumpSendBuffer();

with

void DumpSendBuffer();

Error 3

In file included from ./trace/cmu-trace.h:43:0,

from src_rtg/sragent.cc:53:

./mobile/god.h: At global scope:

./mobile/god.h:88:14: error: extra qualification ‘vector::’ on member ‘operator=’ [-fpermissive]

./mobile/god.h:93:14: error: extra qualification ‘vector::’ on member ‘operator+=’ [-fpermissive]

./mobile/god.h:98:13: error: extra qualification ‘vector::’ on member ‘operator==’ [-fpermissive]

./mobile/god.h:101:13: error: extra qualification ‘vector::’ on member ‘operator!=’ [-fpermissive]

make: *** [src_rtg/sragent.o] Error 1

Ns make failed!

Sol:

/ns-allinone-2.29/ns-2.29/mobile

open god.h

Replace the commented lines with the line following them

//inline void vector::operator=(const vector a) {

inline void operator=(const vector a) {

X = a.X;

Y = a.Y;

Z = a.Z;

}

//inline void vector::operator+=(const vector a) {

inline void operator+=(const vector a) {

X += a.X;

Y += a.Y;

Z += a.Z;

}

//inline int vector::operator==(const vector a) {

inline int operator==(const vector a) {

return (X == a.X && Y == a.Y && Z == a.Z);

}

//inline int vector::operator!=(const vector a) {

inline int operator!=(const vector a) {

return (X != a.X || Y != a.Y || Z != a.Z);

}

Error 4

queue/red.cc: In member function ‘virtual void REDQueue::trace(TracedVar*)’:

queue/red.cc:874:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/red.cc:875:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/red.cc:876:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/red.cc:877:41: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/red.o] Error 1

Ns make failed!

Sol:

/ns-allinone-2.29/ns-2.29/queue

open red.cc

void

REDQueue::trace(TracedVar* v)

{

Replace the commented line with the lines following them

//char wrk[500], *p;

char wrk[500];

const char *p;

Error 5

dsr/dsragent.cc:2737:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

dsr/dsragent.cc:2756:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [dsr/dsragent.o] Error 1

Ns make failed!

Sol:

/ns-allinone-2.29/ns-2.29/dsr

open dsragent.cc

add these callback helpers before SendBuf management and helpers

/* Callback helpers */

void

XmitFailureCallback(Packet *pkt, void *data)

{

DSRAgent *agent = (DSRAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

void

XmitFlowFailureCallback(Packet *pkt, void *data)

{

DSRAgent *agent = (DSRAgent *)data;

agent->xmitFlowFailed(pkt);

}

Error 6

dsr/dsragent.cc: In function ‘void XmitFailureCallback(Packet*, void*)’:

dsr/dsragent.cc:2802:1: error: redefinition of ‘void XmitFailureCallback(Packet*, void*)’

dsr/dsragent.cc:218:1: error: ‘void XmitFailureCallback(Packet*, void*)’ previously defined here

dsr/dsragent.cc:2614:1: error: ‘void DSRAgent::xmitFailed(Packet*, const char*)’ is private

dsr/dsragent.cc:2805:24: error: within this context

dsr/dsragent.cc: In function ‘void XmitFlowFailureCallback(Packet*, void*)’:

dsr/dsragent.cc:2809:1: error: redefinition of ‘void XmitFlowFailureCallback(Packet*, void*)’

dsr/dsragent.cc:225:1: error: ‘void XmitFlowFailureCallback(Packet*, void*)’ previously defined here

dsr/dsragent.cc:2562:1: error: ‘void DSRAgent::xmitFlowFailed(Packet*, const char*)’ is private

dsr/dsragent.cc:2812:28: error: within this context

make: *** [dsr/dsragent.o] Error 1

Ns make failed!

Sol:

/ns-allinone-2.29/ns-2.29/dsr

open dsragent.cc

Remove these lines starting from 2802 and 2809

void

XmitFailureCallback(Packet *pkt, void *data)

{

DSRAgent *agent = (DSRAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

void

XmitFlowFailureCallback(Packet *pkt, void *data)

{

DSRAgent *agent = (DSRAgent *)data;

agent->xmitFlowFailed(pkt);

}

Error 7

diffusion/diffusion.cc: In member function ‘void DiffusionAgent::MACprepare(Packet*, nsaddr_t, int, bool)’:

diffusion/diffusion.cc:427:26: error: ‘XmitFailedCallback’ was not declared in this scope

make: *** [diffusion/diffusion.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/diffusion

open diffusion.cc

add these

/* Callback helper */

void XmitFailedCallback(Packet *pkt, void *data)

{

DiffusionAgent *agent = (DiffusionAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

After this line

#include “routing_table.h”

Error 8

char *MsgStr[]= {“”, “INTEREST”, “DATA”, “DATA_READY”, “DATA_REQUEST”,

diffusion/diffusion.cc: In function ‘void XmitFailedCallback(Packet*, void*)’:

diffusion/diffusion.cc:468:6: error: redefinition of ‘void XmitFailedCallback(Packet*, void*)’

diffusion/diffusion.cc:84:6: error: ‘void XmitFailedCallback(Packet*, void*)’ previously defined here

diffusion/diffusion.h:197:8: error: ‘void DiffusionAgent::xmitFailed(Packet*)’ is protected

diffusion/diffusion.cc:471:24: error: within this context

make: *** [diffusion/diffusion.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/diffusion

open diffusion.cc

remove these lines starting from 468

void XmitFailedCallback(Packet *pkt, void *data)

{

DiffusionAgent *agent = (DiffusionAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

Error 9

diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::ConsiderNew(Packet*)’:

diffusion/omni_mcast.cc:243:19: warning: variable ‘hashPtr’ set but not used [-Wunused-but-set-variable]

diffusion/omni_mcast.cc:246:25: warning: variable ‘forward_nodeID’ set but not used [-Wunused-but-set-variable]

diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::MACprepare(Packet*, nsaddr_t, unsigned int, bool)’:

diffusion/omni_mcast.cc:388:26: error: ‘OmniMcastXmitFailedCallback’ was not declared in this scope

make: *** [diffusion/omni_mcast.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/diffusion

open omni_mcast.cc

Add these lines

/* Callback helper */

void OmniMcastXmitFailedCallback(Packet *pkt, void *data)

{

OmniMcastAgent *agent = (OmniMcastAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

after this line

#include “god.h”

and before

static class OmniMcastClass : public TclClass {

Error 10

diffusion/omni_mcast.cc: In function ‘void OmniMcastXmitFailedCallback(Packet*, void*)’:

diffusion/omni_mcast.cc:429:6: error: redefinition of ‘void OmniMcastXmitFailedCallback(Packet*, void*)’

diffusion/omni_mcast.cc:84:6: error: ‘void OmniMcastXmitFailedCallback(Packet*, void*)’ previously defined here

diffusion/omni_mcast.h:212:8: error: ‘void OmniMcastAgent::xmitFailed(Packet*)’ is protected

diffusion/omni_mcast.cc:432:24: error: within this context

make: *** [diffusion/omni_mcast.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/diffusion

open omni_mcast.cc

Remove the these lines starting from 429

void OmniMcastXmitFailedCallback(Packet *pkt, void *data)

{

OmniMcastAgent *agent = (OmniMcastAgent *)data; // cast of trust

agent->xmitFailed(pkt);

}

Error 11

queue/rio.cc: In member function ‘virtual void RIOQueue::trace(TracedVar*)’:

queue/rio.cc:565:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:566:38: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:567:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:568:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:569:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:570:40: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rio.cc:571:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/rio.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/queue

open rio.cc

Replace this line

char wrk[500], *p;

with lines

char wrk[500];

const char *p;

in

void

RIOQueue::trace(TracedVar* v)

{

Error 12

tcp/tcp-sack-rh.cc: At global scope:

tcp/tcp-sack-rh.cc:68:15: error: extra qualification ‘SackRHTcpAgent::’ on member ‘newack’ [-fpermissive]

make: *** [tcp/tcp-sack-rh.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/tcp

open tcp-sack-rh.cc

Replace this line

virtual void SackRHTcpAgent::newack(Packet* pkt);

with

virtual void newack(Packet* pkt);

in

class SackRHTcpAgent : public TcpAgent {

Error 13

queue/pi.cc: In member function ‘virtual void PIQueue::trace(TracedVar*)’:

queue/pi.cc:316:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/pi.cc:317:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/pi.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/queue

open pi.cc

Replace this line

char wrk[500], *p;

with lines

char wrk[500];

const char *p;

in

void PIQueue::trace(TracedVar* v)

{

Error 14

queue/vq.cc: In member function ‘virtual void Vq::trace(TracedVar*)’:

queue/vq.cc:333:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/vq.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/queue

open vq.cc

Replace this line

char wrk[500], *p;

with lines

char wrk[500];

const char *p;

in

void Vq::trace(TracedVar* v)

{

Error 15

queue/rem.cc: In member function ‘virtual void REMQueue::trace(TracedVar*)’:

queue/rem.cc:335:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rem.cc:336:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

queue/rem.cc:337:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/rem.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/queue

open rem.cc

Replace this line

char wrk[500], *p;

with lines

char wrk[500];

const char *p;

in

void REMQueue::trace(TracedVar* v)

{

Error 16

queue/gk.cc: In member function ‘virtual void GK::trace(TracedVar*)’:

queue/gk.cc:207:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

make: *** [queue/gk.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/queue

open gk.cc

Replace this line

char wrk[500], *p;

with line

char wrk[500];

const char *p;

in

void GK::trace(TracedVar* v)

{

Error 17

pgm/pgm-agent.cc: At global scope:

pgm/pgm-agent.cc:307:8: error: extra qualification ‘PgmAgent::’ on member ‘trace_event’ [-fpermissive]

pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_rdata(Packet*)’:

pgm/pgm-agent.cc:607:30: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_nak(Packet*)’:

pgm/pgm-agent.cc:756:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_ncf(Packet*)’:

pgm/pgm-agent.cc:853:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [pgm/pgm-agent.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/pgm

open pgm-agent.cc

replace line no. 307

void PgmAgent::trace_event(char *evType, double evTime);

with

void trace_event(char *evType, double evTime);

Error 18

pgm/pgm-sender.cc: At global scope:

pgm/pgm-sender.cc:189:8: error: extra qualification ‘PgmSender::’ on member ‘trace_event’ [-fpermissive]

pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::handle_nak(Packet*)’:

pgm/pgm-sender.cc:501:67: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::send_rdata(RdataItem*)’:

pgm/pgm-sender.cc:645:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [pgm/pgm-sender.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/pgm

open pgm-sender.cc

replace line no. 189

void PgmSender::trace_event(char *evType, nsaddr_t daddr, double evTime);

with

void trace_event(char *evType, nsaddr_t daddr, double evTime);

Error 19

pgm/pgm-receiver.cc: At global scope:

pgm/pgm-receiver.cc:186:8: error: extra qualification ‘PgmReceiver::’ on member ‘trace_event’ [-fpermissive]

pgm/pgm-receiver.cc: In member function ‘void PgmReceiver::generate_Nak(int)’:

pgm/pgm-receiver.cc:617:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

make: *** [pgm/pgm-receiver.o] Error 1

Ns make failed!

Sol

/ns-allinone-2.29/ns-2.29/pgm

open pgm-receiver.cc

replace line no. 186

void PgmReceiver::trace_event(char *evType, double evTime);

with
void trace_event(char *evType, double evTime);

Leave a Reply

Your email address will not be published. Required fields are marked *