ubuntu14.04安装OMNET++4.1

本文介绍在Ubuntu 18.04系统中安装指定低版本OMNET++的具体步骤,包括解决配置过程中的警告及编译时遇到的两个典型错误:abspath.cc和matchexpression.y文件的问题,并给出了解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在ubuntu18.04上安装OMNET++5.3时,按官网安装手册顺利安装,但由于其它软件对OMNET++版本的要求,需要安装的低版本的OMNET++。

 安装基本步骤参照安装手册,这里不在赘述。


在./configure命令后出现的警告,都安装相应的库就可以解决。


make后会出现以下问题

问题一:

make[1]: *** [/home/ivyfan/ccnsim_new/omnetpp-4.1/out/gcc-release/src/utils/abspath] Error 1

make[1]: Leaving directory `/home/ivyfan/ccnsim_new/omnetpp-4.1/src/utils'

make: *** [utils] Error 2

 

解决方法:

在文件src/utils/abspath.cc中增加:#include <unistd.h>

Save and compile again. Problem solved.

 

 

问题二:

make[1]: *** [/home/ivyfan/ccnsim_new/omnetpp-4.1/out/gcc-release/src/common/matchexpression.tab.o] Error 1

make[1]: Leaving directory `/home/ivyfan/ccnsim_new/omnetpp-4.1/src/common'

make: *** [common] Error 2

参考文件:https://dev.omnetpp.org/bugs/view.php?id=679&nbn=1

 

解决方法:在/src/common/matchexpression.y  →隐藏文件

共修改三处

 

1)

%token STRINGLITERAL

%token OR_ AND_ NOT_   /* note: cannot use %left/%right because of implicit "or" operator */

 

-%pure_parser   

+%pure-parser

+%param {void *statePtr}

 

%start expression

 

 

2)

 #include <string.h>         /* YYVERBOSE needs it */

 #endif

 

-void yyerror (const char *s);

+void yyerror (void *statePtr, const char *s);

 

 #include "matchexpression.h"

 #include "matchexpressionlexer.h"

 

 

3

void MatchExpression::parsePattern(std::vector<MatchExpression::Elem>& elems, coyyparse(&state);

 }

 

-void yyerror(const char *s)

+void yyerror(void *statePtr, const char *s)

 {

     // chop newline

     char buf[250];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值