在Ubuntu上安装Artery时,构建INET会引发异常错误

时间:2017-11-20 11:52:42

标签: omnet++ veins inet

我目前正在建立一台带有Omnet ++,Veins和Artery的新PC,用于模拟ITS-G5协议。在Artery的根目录中调用make inet后,我收到以下错误消息:

$ make inet
cd extern/inet; python inet_featuretool disable packetdrill SCTP SCTP_examples
Disabling feature(s):  packetdrill, SCTP_examples, SCTP
opp_featuretool: .oppfeaturestate file updated.
opp_featuretool: .nedexclusions file updated.
make -C extern/inet makefiles
make[1]: Entering directory '/home/wiconlab/Car2x/artery-master/extern/inet'
Creating Makefile in /home/wiconlab/Car2x/artery-master/extern/inet/src...
make[1]: Leaving directory '/home/wiconlab/Car2x/artery-master/extern/inet'
make -C extern/inet/src
make[1]: Entering directory '/home/wiconlab/Car2x/artery-master/extern/inet/src'
*** COMPILING with:
g++ -c -std=c++11 -O3 -march=native -mtune=native -DNDEBUG=1 -MMD -MP -MF .d  -fPIC  -fno-stack-protector -DHAVE_SWAPCONTEXT -DWITH_MPI -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_TKENV -DWITH_PARSIM -DWITH_NETBUILDER -DWITH_OSG -DWITH_OSGEARTH -Wno-overloaded-virtual -include inet/common/precompiled.h   -I. -I/home/wiconlab/Car2x/omnetpp-5.2/include
*** LINKING with:
g++ -shared -fPIC -o ../out/gcc-release/src/libINET.so -Wl,--no-as-needed -Wl,--whole-archive  -Wl,--no-whole-archive -loppenvir -loppsim -ldl -lstdc++  -lOpenThreads -losg -losgText -losgDB -losgEarth -losgEarthUtil -Wl,-rpath,/home/wiconlab/Car2x/omnetpp-5.2/lib -Wl,-rpath,/lib -Wl,-rpath,.  -L/home/wiconlab/Car2x/omnetpp-5.2/lib
Building...
Creating precompiled header for gcc...
MSGC: inet/applications/base/ApplicationPacket.msg

...  *ABBREVIATED FOR CLARITY*

inet/networklayer/ipv4/RoutingTableRecorder.cc
inet/networklayer/ipv4/RoutingTableRecorder.cc: In member function ‘virtual void inet::RoutingTableRecorder::recordInterfaceChange(omnetpp::cModule*, const inet::InterfaceEntry*, omnetpp::simsignal_t)’:
inet/networklayer/ipv4/RoutingTableRecorder.cc:207:15: error: expected ‘)’ before ‘INT64_PRINTF_FORMAT’
 #define LL    INT64_PRINTF_FORMAT  // for eventnumber_t
           ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:296:37: note: in expansion of macro ‘LL’
 fprintf(routingLogFile, "%s  %" LL "d  %s  %d  %s %s\n",
                                 ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:303:13: warning: spurious trailing ‘%’ in format [-Wformat=]
         );
         ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:303:13: warning: too many arguments for format [-Wformat-extra-args]
inet/networklayer/ipv4/RoutingTableRecorder.cc: In member function ‘virtual void inet::RoutingTableRecorder::recordRouteChange(omnetpp::cModule*, const inet::IRoute*, omnetpp::simsignal_t)’:
inet/networklayer/ipv4/RoutingTableRecorder.cc:207:15: error: expected ‘)’ before ‘INT64_PRINTF_FORMAT’
 #define LL    INT64_PRINTF_FORMAT  // for eventnumber_t
           ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:323:36: note: in expansion of macro ‘LL’
 fprintf(routingLogFile, "%s %" LL "d  %s  %d  %s  %s  %d  %s\n",
                                ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:332:13: warning: spurious trailing ‘%’ in format [-Wformat=]
         );
         ^
inet/networklayer/ipv4/RoutingTableRecorder.cc:332:13: warning: too many arguments for format [-Wformat-extra-args]
Makefile:1134: recipe for target '../out/gcc-release/src/inet/networklayer/ipv4/RoutingTableRecorder.o' failed
make[1]: *** [../out/gcc-release/src/inet/networklayer/ipv4/RoutingTableRecorder.o] Error 1
make[1]: Leaving directory '/home/wiconlab/Car2x/artery-master/extern/inet/src'
Makefile:21: recipe for target 'inet' failed
make: *** [inet] Error 2

我正在使用最新的 Ubuntu 16.04 LTS ,使用 cmake 3.9.6 进行编译,构建Veins和Vanetza工作没有问题。 Omnet ++版本为5.2 。代码行,错误指的是:

203 namespace inet {
204
205 Define_Module(RoutingTableRecorder);
206
207 #define LL    INT64_PRINTF_FORMAT  // for eventnumber_t

然而,在第207行之前期待“)”对我来说毫无意义 此外,几周前在不同系统(相同操作系统)上构建Artery时未出现此错误。使用早期版本的源代码也没有任何效果。

2 个答案:

答案 0 :(得分:1)

您正在使用 OMNeT ++ 5.2 。 这似乎是问题,因为API略有改变。

INT64_PRINTF_FORMAT OMNeT ++ 5.2 中不再可用。

更改回 OMNeT ++版本5.1 应该可以解决您的错误!

答案 1 :(得分:-1)

fprintf(routingLogFile,“%s%”LL“d%s%d%s%s%d%s \ n”,                                 ^ inet / networklayer / ipv4 / RoutingTableRecorder.cc:332:13:警告:格式为[%]格式的伪造尾随'%'          );

这只是一个简单的语法错误。通过路径Inet / src / inet / networlayer / ipv4 /并打开RoutingTableRecord.cc文件并在“fprintf(routingLogFile,”%s%“LL”d%s%d%s%s%s%d%s \ n“,”行和删除LL,包括LL周围的双引号。这个C代码中有两个。所以请确保它们都像下面的行一样被修正:fprintf(routingLogFile,“%s%d %s%d%s%s%d%s \ n“,。

你可能还需要在270左右的行号注释#define LL INT64_PRINTF_FORMAT // for eventnumber_。

然后保存并仅清除inet项目。然后Build也只是inet项目。