Skip to content

librealsense failed to build due to error C2280 with /std:c++latest option in VS 2022 #14449

@KarenHuang2016

Description

@KarenHuang2016

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:

  1. Open VS202 x64 CMD.
  2. git clone https://github.com/IntelRealSense/librealsense C:\gitP\IntelRealSense\librealsense
  3. 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-
  4. cd /d C:\gitP\IntelRealSense
  5. mkdir build_amd64 && cd build_amd64
  6. 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 ..
  7. 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> &std::operator <<<std::char_traits>(std::basic_ostream<char,std::char_traits> &,const wchar_t *)': attempting to reference a deleted function [C:\gitP\IntelRealSense\librealsense\build_amd64\realsense2.vcxproj]
50>C:\gitP\IntelRealSense\librealsense\src\mf\mf-backend.cpp(32,9): error C2088: built-in operator '<<' cannot be applied to an operand of type 'std::basic_ostream<char,std::char_traits>' [C:\gitP\IntelRealSense\librealsense\build_amd64\realsense2.vcxproj]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions