librealsense failed to build due to error C2280 with /std:c++latest option in VS 2022
The MSVC team regularly builds popular open-source projects, including yours, with development versions of the build tools in order to find and fix regressions in the compiler and libraries before they can ship and cause trouble for the world. This also allows us to provide advance notice of breaking changes, which is the case here.
librealsense failed to build due to error C2280 with /std:c++latest option in VS 2022. Could you please help to take a look at this? Thanks in advance!
Repro steps:
- Open VS202 x64 CMD.
- git clone https://github.com/IntelRealSense/librealsense C:\gitP\IntelRealSense\librealsense
-
set _CL_=/std:c++latest /D_HAS_AUTO_PTR_ETC=1 /D_HAS_DEPRECATED_ALLOCATOR_MEMBERS /D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING /Zc:strictStrings- /Zc:char8_t- /Zc:equalityRewrite- - cd /d C:\gitP\IntelRealSense
- mkdir build_amd64 && cd build_amd64
- cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DBUILD_LEGACY_LIVE_TEST=true -DBUILD_EXAMPLES=true -DBUILD_WITH_TM2=true -DCHECK_FOR_UPDATES=true ..
- msbuild /m /p:Platform=x64 /p:Configuration=Release realsense2.sln /t:Rebuild
Actual result:
50>C:\gitP\IntelRealSense\librealsense\src\mf\mf-backend.cpp(32,9): error C2280: 'std::basic_ostream<char,std::char_traits
Hi @KarenHuang2016 Thanks very much for your report. I will discuss it with my RealSense colleagues.
Currently the SDK is targeted to C++14 standard. https://github.com/IntelRealSense/librealsense/releases/tag/v2.57.4 Please see under supported languages. Thank you.
@KarenHuang2016 Thanks for the heads up. Is it possible you suggest a PR that fix it? Does GitHubs Actions support VS 2022?
Hi @KarenHuang2016 Can you provide a response regarding the comments from my RealSense colleagues above, please? Thanks!