提示:由于实验需要,安装的低版本的OMNET++,可能高版本的不会出现以下问题。Linux问题太多,可以用window尽量用window(简直是一键安装成功好吗。)
前期准备请参照youtube视频,已下载到云盘:
https://pan.baidu.com/s/1c1PVv1I
make MODE=release 中出现了一下问题:
问题一:
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];
问题三:build 第一个project的时候,出现报错:omnet++ library files for configuration "gcc-debug" were not found
解决方案: make MODE=debug CONFIGNAME=gcc-debug all