我是静脉和omnet ++的新手。我按照本教程http://veins.car2x.org/tutorial/的说明,所有步骤都可以进行到第3步,由于某些原因,静脉4.7无法在omnet ++ 5(IDE)中构建,并生成以下错误。

veins/modules/utility/TimerManager.cc
In file included from veins/modules/utility/TimerManager.cc:20:
.\veins/modules/utility/TimerManager.h:137:26: error: expected identifier
  enum class StartMode { RELATIVE, ABSOLUTE, IMMEDIATE };
                         ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
In file included from veins/modules/utility/TimerManager.cc:20:
.\veins/modules/utility/TimerManager.h:137:36: error: expected identifier
  enum class StartMode { RELATIVE, ABSOLUTE, IMMEDIATE };
                                   ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
In file included from veins/modules/utility/TimerManager.cc:20:
.\veins/modules/utility/TimerManager.h:138:24: error: expected identifier
  enum class EndMode { RELATIVE, ABSOLUTE, REPITITION, OPEN };
                       ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
In file included from veins/modules/utility/TimerManager.cc:20:
.\veins/modules/utility/TimerManager.h:138:34: error: expected identifier
  enum class EndMode { RELATIVE, ABSOLUTE, REPITITION, OPEN };
                                 ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:42:28: error: expected unqualified-id
  start_mode_ = StartMode::RELATIVE;
                           ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
veins/modules/utility/TimerManager.cc:48:28: error: expected unqualified-id
  start_mode_ = StartMode::ABSOLUTE;
                           ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:54:24: error: expected unqualified-id
  end_mode_ = EndMode::RELATIVE;
                       ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
veins/modules/utility/TimerManager.cc:60:24: error: expected unqualified-id
  end_mode_ = EndMode::ABSOLUTE;
                       ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:86:19: error: expected unqualified-id
  case StartMode::RELATIVE:
                  ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
veins/modules/utility/TimerManager.cc:88:30: error: expected unqualified-id
    start_mode_ = StartMode::ABSOLUTE;
                             ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:90:19: error: expected unqualified-id
  case StartMode::ABSOLUTE:
                  ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:98:17: error: expected unqualified-id
  case EndMode::RELATIVE:
                ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1434:18: note: expanded from macro 'RELATIVE'
#define RELATIVE 2
                 ^
veins/modules/utility/TimerManager.cc:100:26: error: expected unqualified-id
    end_mode_ = EndMode::ABSOLUTE;
                         ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:102:17: error: expected unqualified-id
  case EndMode::ABSOLUTE:
                ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
veins/modules/utility/TimerManager.cc:106:26: error: expected unqualified-id
    end_mode_ = EndMode::ABSOLUTE;
                         ^
C:\Users\Abu\src\omnetpp-5.3\tools\win64\mingw64\x86_64-w64-mingw32\include\wingdi.h:1433:18: note: expanded from macro 'ABSOLUTE'
#define ABSOLUTE 1
                 ^
15 errors generated.
make[1]: *** [Makefile:205: ../out/clang-debug/src/veins/modules/utility/TimerManager.o] Error 1
make[1]: Leaving directory '/c/Users/Abu/src/veins-4.7/src'
make: *** [Makefile:12: all] Error 2


我也在使用sumo_win64_0.32.0。我不确定是什么原因导致这些错误。

任何帮助是极大的赞赏。

最佳答案

此问题已在this pull request中修复,并且已发布了新的Veins小修订版(即Veins 4.7.1)。请下载新版本以获取修补程序以及一些其他改进。

关于c++ - Windows 7中的Veins 4.7 Omnet++ 5.3构建错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50668999/

10-11 15:11