NS错误系列
proxytrace2any.cc: In function `int main(int, char**)':
proxytrace2any.cc:112: error: `IsLittleEndian' undeclared (first use this
function)
proxytrace2any.cc:112: error: (Each undeclared identifier is reported only
once for each function it appears in.)
proxytrace2any.cc:120: error: `ToOtherEndian' undeclared (first use this
function)
make[1]: *** [proxytrace2any.o] Error 1
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb'
proxytrace2any.cc:112: error: `IsLittleEndian' undeclared (first use this
function)
proxytrace2any.cc:112: error: (Each undeclared identifier is reported only
once for each function it appears in.)
proxytrace2any.cc:120: error: `ToOtherEndian' undeclared (first use this
function)
make[1]: *** [proxytrace2any.o] Error 1
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb'
解答一:我试了下,貌似不行。
这个问题在NS2.30上添加MFlood协议也会出现,报错的地方只是编译上出错,如果不修改这个错误并不影响使用。可以用以 下的方法来解决这个错误:
修改proxytrace2any.cc文件,在其中的main函数之前,添加
extern int IsLittleEndian(void);
extern void ToOtherEndian(TEntry *e ) ;
存盘退出,重新编译 再make 一次
解法二:
对于这个问题,已经找打了解答,希望能为同样寻找答案的同学有所帮助/
首先,这个错误并不影响使用,至少我还没遇见什么其他的错误,不解决也没问题,可能是一些linkage errors
另外,如果想去掉这个错误,可以加上如下代码:
int IsLittleEndian(void);
void ToOtherEndian(TEntry *e);
void ToOtherEndian(TEntry *e);
in .../ns-2.31/indep-utils/webtrace-conv/dec/Proxytrace2any.cc
这是网上一个不认识的热心人告诉我的,我试了一下,果然没错误了
解法三:
把in .../ns-2.31/indep-utils/webtrace-conv/dec/my-endian.h中的预编译指令改一下就可以了
#ifndef _ENDIAN_H_
#define _ENDIAN_H_
改成
#ifndef _ENDIAN_HHHH_
#define _ENDIAN_HHHH_
或者你认为的任意不会发生冲突的宏