Archive for June 2, 2008

重新編譯ns2的問題:proxytrace2any.cc error

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

問題點在於「proxytrace2any.cc」這隻程式,因為使用到兩個未經定義(undeclared)的函數。修正方法:找到檔案 /indep-utils/webtrace-conv/dec/my-endian.h
將下列兩行註解起來:
#ifndef _ENDIAN_H_ 與
#endif
如同下面範例:

//#ifndef _ENDIAN_H_ ... 註解
#define _ENDIAN_H_
#include "proxytrace.h"
 
/* detects endian-ness */
int IsLittleEndian(void);
 
/* changes endian-ness */
void ToOtherEndian(TEntry *e);
//#endif [...]