[ns] compilation problem.

Dimitris Liarokapis l.dhmhtrhs at gmail.com
Thu Jun 12 03:20:39 PDT 2008


Hi all,

I have encountered an issue while researching a new broadcast algorithm that
i have implemented.
My protocol makes use of two files. A .h and a .cc file.
Inside the header file i define a constant as follows.

#define CONSTANT value1


When i first compiled my code it seemed to work fine with no problems at
all.
There was a point where i had to change this CONSTANT to have a different
value.

So o changed value1 with value2.

I tried to recompile ns using "make" and "make install".
For some reason the output of the compilation seemed not to be similar to a
normal successful compilation.
Although the end result seemed to be successful.
More specifically, i got exactly the same output as if i have compiled ns
after having made no changes at all.
It seemed very strange so i tried to debug my code.
I found out that even if i have changed CONSTANT from value1 to value2 when
i run the program,
CONSTANT equals with the old value1, as if i have never changed it or
compiled it.

Do you have any ideas why this is happening?
Do you think this is an ns bug???

I have resolved this issue by declaring a variable inside the .cc file as
follows.
int constant = value2
I recompiled and it worked fine. But normally this should not be the case
and i should be able
use constants in the header file and change them as appropriate.

Best Regards

Dimitris


More information about the Ns-users mailing list