microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.06k stars 4.48k forks source link

[MSVC][permissive-][std:c++latest] Airsim failed to build with msvc due to error C2664 on Windows #4717

Open fangzhouxia opened 1 year ago

fangzhouxia commented 1 year ago

Bug report

What's the issue you encountered?

Hi all, when we compile AirSim under VS 2019, error C2664 appears. Could you help look?

Settings

How can the issue be reproduced?

  1. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64 & set CL= /permissive-
  2. git clone https://github.com/microsoft/AirSim F:\AirSim
  3. cd F:\AirSim
  4. curl https://github.com/rpclib/rpclib/archive/v2.3.0.zip -O -L 2>&1
  5. set PATH=F:\tools\7-Zip;%PATH%
  6. 7z x v2.3.0.zip -oF:\AirSim\external\rpclib -aoa 2>&1
  7. curl https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip -O -L 2>&1
  8. 7z x eigen-3.3.7.zip -oF:\AirSim\AirLib\include -aoa 2>&1
  9. Change "#include "Eigen/Dense"" to "#include "eigen-3.3.7/Eigen/Dense"" in file VectorMath.hpp
  10. Change CommonSetup.cmake file '/ZI' change to '/std:c++17 /'
  11. cd cmake
  12. mkdir build_amd64
  13. cd F:\AirSim\cmake\build_amd64
  14. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release .. 2>&1
  15. msbuild /m /p:Platform=x64 /p:Configuration=Release AirSim.sln /t:Rebuild 2>&1

    Include full error message in text form

    22>F:\gitP\microsoft\AirSim\DroneShell\include\linenoise.hpp(722,21): error C2664: 'void linenoise::ansi::SendSequence(LPWSTR)': cannot convert argument 1 from 'const wchar_t [5]' to 'LPWSTR' [F:\gitP\microsoft\AirSim\cmake\build_amd64\DroneShell\DroneShell.vcxproj]

detail log build (23).log

What's better than filing an issue? Filing a pull request :).