给出 "make" 命令时出错

error occurred while giving the "make" command

在键入 "make" 命令时遇到错误

make MODE=release

make[1]: Entering directory '/home/deepak/omnetpp-4.2.2'

***** Configuration: MODE=release, TOOLCHAIN_NAME=gcc, LIB_SUFFIX=.so ****

===== Checking environment =====

mkdir -p /home/deepak/omnetpp-4.2.2/bin

===== Compiling utils ====

cd /home/deepak/omnetpp-4.2.2/src/utils && make

make[2]: Entering directory '/home/deepak/omnetpp-4.2.2/src/utils'

g++ abspath.cc -o /home/deepak/omnetpp-4.2.2/out/gcc-release/src/utils/abspath

abspath.cc: In function ‘std::string toAbsolutePath(const char*)’:

abspath.cc:62:38: error: ‘getcwd’ was not declared in this scope

   return std::string(getcwd(wd,1024)) + "/" + pathname; //XXX results in double slash if wd is the root

                                   ^

Makefile:59: recipe for target '/home/deepak/omnetpp-4.2.2/out/gcc-release/src/utils/abspath' failed

make[2]: *** [/home/deepak/omnetpp-4.2.2/out/gcc-release/src/utils/abspath] Error 1

make[2]: Leaving directory '/home/deepak/omnetpp-4.2.2/src/utils'

Makefile:96: recipe for target 'utils' failed

make[1]: *** [utils] Error 2

make[1]: Leaving directory '/home/deepak/omnetpp-4.2.2'

Makefile:19: recipe for target 'allmodes' failed

make: *** [allmodes] Error 2

导致此故障的原因是什么?

此错误是由于om-net++版本与对应的Ubuntu版本不兼容, 从以下地址下载最新版本的 om-net++ link

http://omnetpp.org/omnetpp/category/30-omnet-releases

然后解压享受吧。 :)