facebook / folly

An open-source C++ library developed and used at Facebook.
https://groups.google.com/forum/?fromgroups#!forum/facebook-folly
Apache License 2.0
28.23k stars 5.54k forks source link

Folly failed to build due to error C2027 on MSVC #1430

Open QuellaZhang opened 4 years ago

QuellaZhang commented 4 years ago

Hi All,

Folly failed to build due to error C2027 on MSVC. This issue can be reproduced on latest version. Could you please help take a look at this? Thanks in advance!

Environment VCPKG latest revision + Folly latest version + VS 2019 + Windows Server 2016

Repro steps:

  1. open X64 native tools command prompt for VS2019
  2. git clone https://github.com/Microsoft/vcpkg D:\VCPKG\src
  3. cd d:\vcpkg\src
  4. bootstrap-vcpkg.bat
  5. set path=%cd%;%path%
  6. vcpkg install folly:x64-windows -–head

reference: https://developercommunity.visualstudio.com/content/problem/525532/visual-studio-2019-compilation-issue.html

Actual result: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2027: use of undefined type 'std::basic_ostream<char,std::char_traits>' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\iosfwd(217): note: see declaration of 'std::basic_ostream<char,std::char_traits>' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(4706): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits> &std::_Insert_string<char,std::char_traits,unsigned int64>(std::basic_ostream<char,std::char_traits> &,const _Elem *const ,const _SizeT)' being compiled with [ _Elem=char, _SizeT=unsigned int64 ] F:\gitP\microsoft\vcpkg\buildtrees\folly\src\head\master-d012b8a853\folly/experimental/symbolizer/SymbolizedFrame.h(80): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits> &std::operator <<<char,std::char_traits,std::allocator>(std::basic_ostream<char,std::char_traits> &,const std::basic_string<char,std::char_traits,std::allocator> &)' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2065: 'iostate': undeclared identifier C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2146: syntax error: missing ';' before identifier '_State' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2065: '_State': undeclared identifier C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2027: use of undefined type 'std::basic_ostream<char,std::char_traits>' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\iosfwd(217): note: see declaration of 'std::basic_ostream<char,std::char_traits>' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\xstring(482): error C2065: 'goodbit': undeclared identifier

QuellaZhang commented 4 years ago

Any Updates?

Orvid commented 4 years ago

A diff is in the process of being landed that will fix this.