ns2.34
大家好,我在 Fedora 中安装时遇到以下错误。
请帮我解决
collect2: ld returned 1 exit status
make: *** [Makefile:420: ns] Error 1
Ns make failed
答案1
我想完整的错误是:
2. ERROR
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:
tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
tools/ranvar.cc:219:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
make: *** [tools/ranvar.o] Error 1
解决这个问题的方法是:
在ns-2.34/tools/ranvar.cc
,第 219 行
代替
-return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
和
+return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);