Monday, May 19, 2008

ns2 nam編譯問題

使用ns2提供的allinone2.31.tar編譯時,nam會發生下面這個問題

......
nam_stream.o: In function `NamStreamCompressedFile::gets(char*, int)':
nam_stream.cc:(.text+0x1071): undefined reference to `gzgets'
nam_stream.o: In function `NamStreamCompressedFile::NamStreamCompressedFile(char const*)':
nam_stream.cc:(.text+0x10b4): undefined reference to `gzopen'
nam_stream.o: In function `NamStreamCompressedFile::NamStreamCompressedFile(char const*)':
nam_stream.cc:(.text+0x1136): undefined reference to `gzopen'
collect2: ld returned 1 exit status
make: *** [nam] Error 1

這個問題只要把nam資料夾下的Makefile稍作修改即可

LIB = \
-L/home/hct/ns-allinone-2.31/tclcl-1.19 -ltclcl -L/home/hct/ns-allinone-2.31/otcl -lotcl -L/home/hct/ns-allinone-2.31/lib -ltk8.4 -L/home/hct/ns-allinone-2.31/lib -ltcl8.4 -lz \

(紅字為增加部份)

1 comment:

Jiani Wu said...

Dear:
I tried to put '-lz' in told place, however, after I re-run ./install, it automatically gives same problem. Found out that the Makefile goes back to original('-lz' disappeared).
Do you have any ideas?
thanks in advance