Sorry for my poor english, but I thing it will be usefull for someone
else....

Problem compiling NS 2.27 on Fedora Core 4 (FC4)

It was a long history :)

I put numbers cause it easy to understand...

Linux 2.6.11-1.1369_FC4 #1 i686 i686 i386 GNU/Linux
gcc-c++-4.0.0-8 e gcc-4.0.0-8
NS 2.27 (not all in one)

1) First of all, I was experiencing some problems with libtk (I dont have
the message here), so I solve it installing the development kit for X
windows.
I installed libtk but it isn't solve the problem. I saw a lot of messages
about "couldn't find some windows components" I tried intall de X window
development kit, and it solve the problem.

2) I installed the TCL/TK, OTCL and TCLCL without problems (finally), but
otcl and tclcl I use the "--with-tcl=/path" option

3) I was experiencing the errors below and solve the problem with some tips
of http://mailman.isi.edu/pipermail/ns-users/2004-December/046203.html(below
too)

#####################################
3) My errors

In file included from ./common/ip.h:41,
                 from sctp/sctp.cc:41:
./config.h:103:1: warning: "STRTOI64_FMTSTR" redefined
In file included from /opt/ns-allinone-2.27/tclcl-1.15/tclcl.h:47,
                 from ./config.h:60,
                 from ./common/ip.h:41,
                 from sctp/sctp.cc:41:
/opt/ns-allinone-2.27/tclcl-1.15/tclcl-config.h:37:1: warning: this is the
location of the previous definition
sctp/sctp.cc: In destructor 'virtual SctpAgent::~SctpAgent()':
sctp/sctp.cc:154: error: invalid lvalue in assignment
make: ** [sctp/sctp.o] Erro 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

###################################
3) My search on the web

http://mailman.isi.edu/pipermail/ns-users/2004-December/046203.html

Hi,

I read several messages on this list mentioning a problem to compile ns
(namely a forward declaration error in tclcl-mappings.h). It is actually
the first of many problems encountered while compiling with gcc 3.4.2
(shipped with FC3).
Here is the changes to make in ns. Note that I don't know if they are
backward compatible with previous versions of gcc.

* ns-allinone-2.27/tclcl-1.15/tclcl-mappings.h
Move #include "tclcl-mappings.h" from l.48 to l.258

The following files are all relative to ns-allinone-2.27/ns-2.27/
* sctp/sctp.cc
l.154: spCurrNode->vpData = NULL;

* webtraff/webtraff.cc
Block starting l.411:
else if (strcmp(argv[1], "set-num-server") == 0) {
    nServer_ = atoi(argv[2]);
    if (server_ != NULL)
        free(server_);
    server_ = (WebServer*)malloc(nServer_ * sizeof(WebServer));
    for (int i = 0; i < nServer_; i++) {
        server_[i] = WebServer(this);
    }
    return (TCL_OK);
}

* linkstate/ls.h
l.88:
void eraseAll() {
    baseList::erase(baseList::begin(), baseList::end());
}

l.112:
void eraseAll() {
    baseMap::erase(baseMap::begin(), baseMap::end());
}

* diffusion3/lib/nr/nr.hh
add 'template <>' before l.224 and l.239

* in mobile/ gridkeeper.h, gridkeeper.cc
   in diffusion/ diff_rate.cc diffusion.h routing_table.cc
rename the macro max to MAX (otherwise there is some sort of conflict
with std::max). Same with min to MIN.


Hope that helps. I'll try to write a proper patch to fix everything in
the near future.

Mathieu

-- 
Mathieu Robin <mathieu.robin at cs.tcd.ie>
Department of Computer Science
Trinity College Dublin, Ireland
http://www.cs.tcd.ie/Mathieu.Robin/
##########################################

4) So, when I finally solve the errors above I find a message similar to by
http://www.isi.edu/nsnam/ns/ns-problems.html#ns-2.27.
I found one tip at
http://www.winlab.rutgers.edu/~zhibinwu/html/network_simulator_2.html#Fix_Bugs_in_ns-2.27,
but it doesn't work to me.
So, instead of set -DCPP_NAMESPACE=std I edit the autoconf.h and change at
line 85 the word CPP_NAMESPACE by std (just it, if it can't read the
variable I put its real value there).

5) I compilled Nam and xgraph without errors.

Thanks, Renata

Reply via email to