【发布时间】:2014-03-21 15:33:56
【问题描述】:
根据此处提到的步骤安装 ns2 时: http://stanjuly.wordpress.com/2011/12/22/install-ns2-ns-allinone-2-35-on-ubuntu-11-04-for-beginners/
在第 4 步中,当我打开我的 make 文件时,我的 make 文件如下所示:
CC= @CC@
CFLAGS= @CFLAGS@
RANLIB= @RANLIB@
INSTALL= @INSTALL@
#
# how to compile, link, and name shared libraries
#
SHLIB_LD= @SHLIB_LD@
SHLIB_CFLAGS= @SHLIB_CFLAGS@
SHLIB_SUFFIX= @SHLIB_SUFFIX@
SHLD_FLAGS= @DL_LD_FLAGS@
DL_LIBS= @DL_LIBS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
#
# where to install shells, libraries, and includes
#
INST_OTCLSH= @prefix@/bin
INST_OWISH= @prefix@/bin
INST_OLIB= @prefix@/lib
INST_OLIBSH= @INST_OLIBSH@
INST_OINC= @prefix@/include
#
# ------------ you shouldn't need to configure below here -----------------
#
说明说我应该将 CC = @CC@ 更改为 CC = @CC@ -V 4.7.0(4.7.0,因为当我在终端上输入 gcc --version 时会显示):
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
但是当安装 ns2 (step5): sudo ./install 时出现以下错误:
config.status: creating Makefile
rm -f libotcl.a otcl.o
gcc -V 4.7 -c -g -O2 -DNDEBUG -DUSE_SHM -DHAVE_UNISTD_H=1 -I. -I/home/me/ns-
allinone-2.35/include -I/home/me/ns-allinone-2.35/include -I/home/me/ns-
allinone-2.35/include -I/include otcl.c
gcc: error: unrecognized command line option ‘-V’
gcc: error: 4.7: No such file or directory
make: *** [libotcl.a] Error 1
otcl-1.14 make failed! Exiting ...
如果我没有收到此错误,我应该如何修改 makefile?我是否安装了 gcc 编译器?我不明白。我不知道如何检查它是否已安装。
【问题讨论】: