当前位置: 首页 > article >正文

afsim源码编译生成出现错误解决方法

afsim2.9源码编译生成出现错误解决方法

  • 1 afsim2.9源码生成出现错误情况
  • 2 原因及解决方法
    • 2.1 Cmake版本问题及解决办法
    • 2.2 软件冲突问题及解决办法
  • 3 编译成功结果图

1 afsim2.9源码生成出现错误情况

afsim源码进行编译可能会出现如下错误:

C2059 语法错误:“)“ 
C3536 “t”:初始化之前无法使用
C3539 模板参数不能为包含“auto”的类型
C2027 使用了未定义类型std:tuple size<int>” 
C2065 “value”:未声明的标识符
C2059 语法错:“)”
C3536 “t”:初始化之前无法使用
C3539 模板参数不能为包含“auto”的类型
C2027 使用了未定义类型std:tuple size<int>” 
C2065 “value”:未声明的标识符
C2059 语法错误:“)”
C3536 “t”:初始化之前无法使用
C3539 模板参数不能为包含“auto”的类型
C2027 使用了未定义类型std:tuple_size<int>” 
C2065 “value”:未声明的标识符
......

在这里插入图片描述

通过 Visual Studio 对ALL_BUILD生成出现如下结果:

生成成功254个,失败2个,最新0个,跳过0个

在这里插入图片描述

2 原因及解决方法

这里存在两种原因,一种是Cmake版本问题,另外一种是软件之间存在冲突。

2.1 Cmake版本问题及解决办法

不同版本Cmake可能会导致编译出现问题,针对afsim 2.9版本,如果使用3.30版本的出现问题,建议卸载后重新安装3.27.1版本的cmake。

2.2 软件冲突问题及解决办法

如果是经常使用 python 环境,例如anaconda软件,由于anaconda软件自身带有cmake相关应用,通过Cmake进行Configure时,会出现如下情况(非正常情况):
在这里插入图片描述
上面图片中Found GTest正常应该是afsim的src文件夹下,而不是Anaconda文件夹下,但是Anaconda软件的安装目录下也有GTest相关应用,当把Anaconda软件安装目录加入到windows的环境变量后,Cmake找文件优先去环境变量中的路径下找,因此,出现这个情况的原因是把Anaconda相关路径添加到环境变量中,导致搜索出现问题。在这里插入图片描述

解决办法

  • 删除Anaconda在windows系统中对应的环境变量,然后依次点击确认。

3 编译成功结果图

Cmake

CMAKE_VERSION: 3.27.1
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.26100.
The C compiler identification is MSVC 19.29.30157.0
The CXX compiler identification is MSVC 19.29.30157.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Found Git: D:/Git/Git/cmd/git.exe (found version "2.47.1.windows.1") 
AFSIM Version: 2.9.0
AFSIM Release Version: 2.9.0 02-25-2022
Could NOT find Sphinx (missing: Sphinx-build_EXECUTABLE Sphinx-apidoc_EXECUTABLE) 
Performing Test CMAKE_HAVE_LIBC_PTHREAD
Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
Looking for pthread_create in pthreads
Looking for pthread_create in pthreads - not found
Looking for pthread_create in pthread
Looking for pthread_create in pthread - not found
Found Threads: TRUE  
Installing package: E:/afsim/swdev/dependencies/3rd_party/gtest/gtest-1.8.0-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
CMake Warning (dev) at cmake/Modules/ConfigureUnitTests.cmake:24 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  CMake variable GTEST_ROOT is set to:

    E:/afsim/swdev/build/3rd_party/gtest-1.8.0-x64-vs2017

  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  CMakeLists.txt:362 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Found GTest: E:/afsim/swdev/build/3rd_party/gtest-1.8.0-x64-vs2017/lib/gtest.lib  
Performing Test COMPILER_HAS_DEPRECATED_ATTR
Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
Performing Test COMPILER_HAS_DEPRECATED
Performing Test COMPILER_HAS_DEPRECATED - Success
Configuring sensor_plot_lib
Configuring wsf_cyber
Configuring wsf_grammar_check
Configuring wsf_l16
Configuring wsf_mil
Configuring wsf_mil_parser
Configuring wsf_mtt
Configuring wsf_nx
Configuring wsf_parser
Configuring wsf_ripr
Configuring wsf_space
Configuring wsf_weapon_server
Configuring engage
Configuring evt_reader
Configuring mission
Configuring mover_creator
Configuring mystic
Configuring post_processor
Configuring sensor_plot
Configuring warlock
Configuring weapon_tools
Configuring wizard
Configuring wsf_air_combat
Configuring wsf_alternate_locations
Configuring wsf_annotation
Configuring wsf_argo8
Configuring wsf_brawler
Configuring wsf_coverage
Configuring wsf_fires
Configuring wsf_iads_c2
Configuring wsf_multiresolution
Configuring wsf_oms_uci
Configuring wsf_p6dof
Configuring wsf_scenario_analyzer
Configuring wsf_scenario_analyzer_iads_c2
Configuring wsf_simdis
Configuring wsf_six_dof
Configuring wsf_sosm
Found GMock: E:/afsim/swdev/build/3rd_party/gtest-1.8.0-x64-vs2017/lib/gmock.lib  
CMake Warning (dev) at cmake/Modules/FindGMock.cmake:131 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  CMake variable GTEST_ROOT is set to:

    E:/afsim/swdev/build/3rd_party/gtest-1.8.0-x64-vs2017

  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  core/wsf_parser/test/CMakeLists.txt:15 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Found Python3: D:/Python/python.exe (found version "3.12.8") found components: Interpreter 
Installing package: E:/afsim/swdev/dependencies/3rd_party/qt/qt-5.12.11-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Found OpenGL: opengl32   
Installing package: E:/afsim/swdev/dependencies/3rd_party/gdal/gdal-3.3.2-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Installing package: E:/afsim/swdev/dependencies/3rd_party/geos/geos-3.5.1-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Installing package: E:/afsim/swdev/dependencies/3rd_party/osgEarth/osgEarth-2.10.1-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Installing package: E:/afsim/swdev/dependencies/3rd_party/osg/osg-3.6.3-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Installing package: E:/afsim/swdev/dependencies/3rd_party/proj/proj-8.1.1-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Installing package: E:/afsim/swdev/dependencies/3rd_party/tiff/tiff-4.3.0-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Using resource files from directory E:/afsim/swdev/dependencies/resources
Configuring WKF Plugin CoverageOverlay
Configuring WKF Plugin MapDisplay
Configuring WKF Plugin MapHoverInfo
Configuring WKF Plugin ModelBrowser
Configuring WKF Plugin Performance
Configuring WKF Plugin PositionConverterTool
Configuring WKF Plugin TerrainTools
Configuring WKF Plugin TetherView
Configuring WKF Plugin UnitConverterTool
Configuring WKF Plugin VideoCapture
Configuring WKF Plugin Visibility
Configuring MYSTIC Plugin ResultAcesDisplay
Configuring MYSTIC Plugin ResultAirCombatVisualization
Configuring MYSTIC Plugin ResultAnnotation
Configuring MYSTIC Plugin ResultAuxData
Configuring MYSTIC Plugin ResultBattleManagement
Configuring MYSTIC Plugin ResultBehaviorAnalysisTool
Configuring MYSTIC Plugin ResultCommVis
Configuring MYSTIC Plugin ResultComment
Configuring MYSTIC Plugin ResultDataAirCombat
Configuring MYSTIC Plugin ResultDataAnnotation
Configuring MYSTIC Plugin ResultDataCyber
Configuring MYSTIC Plugin ResultDataP6Dof
Configuring MYSTIC Plugin ResultDataSixDOF
Configuring MYSTIC Plugin ResultDataSpace
Configuring MYSTIC Plugin ResultDataWk
Configuring MYSTIC Plugin ResultDetectionReport
Configuring MYSTIC Plugin ResultEngagementAnalysis
Configuring MYSTIC Plugin ResultEventMarker
Configuring MYSTIC Plugin ResultHeadDownView
Configuring MYSTIC Plugin ResultHeadUpView
Configuring MYSTIC Plugin ResultInteractionLines
Configuring MYSTIC Plugin ResultInteractionPlots
Configuring MYSTIC Plugin ResultMerger
Configuring MYSTIC Plugin ResultOrbit
Configuring MYSTIC Plugin ResultOrbitalData
Configuring MYSTIC Plugin ResultP6DOFData
Configuring MYSTIC Plugin ResultPlatformBrowser
Configuring MYSTIC Plugin ResultPlatformData
Configuring MYSTIC Plugin ResultPlatformHistory
Configuring MYSTIC Plugin ResultProjector
Configuring MYSTIC Plugin ResultQuantumTaskerData
Configuring MYSTIC Plugin ResultRelativeGeometry
Configuring MYSTIC Plugin ResultRoute
Configuring MYSTIC Plugin ResultSatelliteTether
Configuring MYSTIC Plugin ResultScriptDataFeed
Configuring MYSTIC Plugin ResultSensorVolumes
Configuring MYSTIC Plugin ResultSituationAwarenessDisplay
Configuring MYSTIC Plugin ResultSixDOF_Data
Configuring MYSTIC Plugin ResultStatistics
Configuring MYSTIC Plugin ResultTimeController
Configuring MYSTIC Plugin ResultTracks
Configuring MYSTIC Plugin ResultVaScenarioManager
Configuring MYSTIC Plugin ResultVisualEffects
Configuring MYSTIC Plugin ResultWsfDraw
Configuring MYSTIC Plugin ResultZones
Installing package: E:/afsim/swdev/dependencies/3rd_party/sdl/sdl-2.0.16-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Configuring WARLOCK Plugin AcesDisplay
Configuring WARLOCK Plugin AdHocScriptBrowser
Configuring WARLOCK Plugin AirToAirVisualization
Configuring WARLOCK Plugin Annotation
Configuring WARLOCK Plugin ApplicationLauncher
Configuring WARLOCK Plugin Astrolabe
Configuring WARLOCK Plugin BattleManagement
Configuring WARLOCK Plugin Chat
Configuring WARLOCK Plugin CommVis
Configuring WARLOCK Plugin Comment
Configuring WARLOCK Plugin CreatePlatform
Configuring WARLOCK Plugin CyberEngagementBrowser
Configuring WARLOCK Plugin CyberEngagementController
Configuring WARLOCK Plugin DemoMode
Configuring WARLOCK Plugin DialogBuilder
Configuring WARLOCK Plugin EventMarker
Configuring WARLOCK Plugin HeadDownView
Configuring WARLOCK Plugin HeadUpView
Configuring WARLOCK Plugin Interactions
Configuring WARLOCK Plugin Joystick
Configuring WARLOCK Plugin Log
Configuring WARLOCK Plugin NetworkBrowser
Configuring WARLOCK Plugin NetworkLog
Configuring WARLOCK Plugin Orbit
Configuring WARLOCK Plugin OrbitalData
Configuring WARLOCK Plugin P6dofController
Configuring WARLOCK Plugin P6dofData
Configuring WARLOCK Plugin P6dofTuner
Configuring WARLOCK Plugin PlatformBrowser
Configuring WARLOCK Plugin PlatformData
Configuring WARLOCK Plugin PlatformHistory
Configuring WARLOCK Plugin PlatformMovement
Configuring WARLOCK Plugin PlatformPartBrowser
Configuring WARLOCK Plugin Projector
Configuring WARLOCK Plugin RelativeGeometry
Configuring WARLOCK Plugin SatelliteTether
Configuring WARLOCK Plugin Scoreboard
Configuring WARLOCK Plugin ScriptBrowser
Configuring WARLOCK Plugin SensorController
Configuring WARLOCK Plugin SensorVolumes
Configuring WARLOCK Plugin SimController
Configuring WARLOCK Plugin SituationAwarenessDisplay
Configuring WARLOCK Plugin SixDofData
Configuring WARLOCK Plugin SixDofTuner
Configuring WARLOCK Plugin TaskAssigner
Configuring WARLOCK Plugin TaskStatus
Configuring WARLOCK Plugin TrackDetailsDisplay
Configuring WARLOCK Plugin Tracks
Configuring WARLOCK Plugin VisualEffects
Configuring WARLOCK Plugin WeaponBrowser
Configuring WARLOCK Plugin WsfDraw
Configuring WARLOCK Plugin WsfPrompt
Configuring WARLOCK Plugin ZoneBrowser
Installing package: E:/afsim/swdev/dependencies/3rd_party/sqlite/sqlite-3.32.3-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Configuring WIZARD Plugin WizACO_Importer
Configuring WIZARD Plugin WizCRDImporter
Configuring WIZARD Plugin WizColorUtils
Configuring WIZARD Plugin WizCommVisPlugin
Configuring WIZARD Plugin WizCommandChainBrowser
Configuring WIZARD Plugin WizDemoBrowser
Configuring WIZARD Plugin WizEngage
Configuring WIZARD Plugin WizErrorList
Configuring WIZARD Plugin WizEventOutput
Configuring WIZARD Plugin WizLogServer
Configuring WIZARD Plugin WizMapAnnotation
Configuring WIZARD Plugin WizMapRoute
Configuring WIZARD Plugin WizMapUtils
Configuring WIZARD Plugin WizModelImport
Configuring WIZARD Plugin WizMysticLauncher
Configuring WIZARD Plugin WizOSMConverter
Configuring WIZARD Plugin WizPartManager
Configuring WIZARD Plugin WizPatternVisualization
Configuring WIZARD Plugin WizPlatformBrowser
Configuring WIZARD Plugin WizPlatformData
Configuring WIZARD Plugin WizProjectBrowser
Configuring WIZARD Plugin WizRouteBrowser
Configuring WIZARD Plugin WizSIMDIS
Configuring WIZARD Plugin WizSPLAT
Configuring WIZARD Plugin WizScenarioAnalyzer
Configuring WIZARD Plugin WizScenarioImporter
Configuring WIZARD Plugin WizSimulationManager
Configuring WIZARD Plugin WizSpaceTools
Configuring WIZARD Plugin WizTablePlotter
Configuring WIZARD Plugin WizTaskList
Configuring WIZARD Plugin WizTypeBrowser
Configuring WIZARD Plugin WizUnitConversion
Configuring WIZARD Plugin WizZoneEditor
Installing package: E:/afsim/swdev/dependencies/3rd_party/tinyxml2/tinyxml2-7.1.0-x64-vs2017.tar.gz to E:/afsim/swdev/build/3rd_party
Configuring done (37.1s)
Generating done (6.9s)

在Visual Studio中对 ALL_BUILD 运行 生成 后错误列表结果如下:

在这里插入图片描述
上面这张图有警告是没有问题的,不影响,可以忽略。下面是对 ALL_BUILD 运行 生成 后的输出结果:
在这里插入图片描述
下面是INSTALL右键点击生成得到的结果:
在这里插入图片描述

上述的方法适用于Cmake和其它软件存在冲突的情况。


http://www.kler.cn/a/459004.html

相关文章:

  • 服务器主机测试网络
  • xadmin后台首页增加一个导入数据按钮
  • C#编写的盘符图标修改器 - 开源研究系列文章
  • Spring Boot 中 TypeExcludeFilter 的作用及使用示例
  • 安装教程:慧集通集成平台(DataLinkX)智能体客户端安装操作(Linux/windows/mac)
  • 详解MySQL在Windows上的安装
  • 单片机中运行多个定时器
  • 【Docker】离线安装 Docker
  • SELECT 语句用法大全:数据库查询的核心力量
  • 【网络安全实验室】基础关实战详情
  • 【发票提取明细+发票号改名】批量提取PDF电子发票明细导出Excel表格并改名技术难点,批量PDF多区域内容识别提取明细并用内容改名的小结
  • Azure Function 解决跨域问题
  • 算法训练营Day28 | leetcode 122.买卖股票的最佳时机II 55.跳跃游戏 45.跳跃游戏II
  • nginx中的proxy_set_header参数详解
  • 18、【OS】【Nuttx】用gdb调试nuttx os
  • 轮胎识别数据集,可对生产流水线里的轮胎图片标注,支持yolo,coco json,voc xml格式的标注,一共785张采集图片
  • IDEA XML 文件 SQL 提示
  • 【每日学点鸿蒙知识】桌面快捷方式API、Swiper显示异常、Page防止截屏、Tabs组件监听显示隐藏、PDF翻页回调
  • ubuntu快速入门
  • 《深入浅出HTTPS​​​​​​​​​​​​​​​​​》读书笔记(22):密钥协商算法
  • Axure RP11安装学习
  • [Day 10]有序数组的平方
  • 平衡车PID算法 学习日记
  • 如何删除Mac上的系统数据
  • 【论文阅读】DebSDF:深入研究神经室内场景重建的细节和偏差
  • Flink 中的 Time 有哪⼏种?