folly icon indicating copy to clipboard operation
folly copied to clipboard

error C2382: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::_Eos': redefinition; different exception specifications

Open Adela0814 opened this issue 2 years ago • 8 comments
trafficstars

When I install fizz via vcpkg, I got the following error, please see https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1899576#3757648 for details, thanks:

E:\Mengna\vcpkg\installed\x64-windows\include\folly/memory/UninitializedMemoryHacks.h(275): error C2382: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::_Eos': redefinition; different exception specifications
\vcfs\Archive\msvc\fe\20230823.13\binaries.amd64ret\inc\xstring(4821): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::_Eos'
E:\Mengna\vcpkg\installed\x64-windows\include\folly/memory/UninitializedMemoryHacks.h(276): error C2382: 'std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>::_Eos': redefinition; different exception specifications
\vcfs\Archive\msvc\fe\20230823.13\binaries.amd64ret\inc\xstring(4821): note: see declaration of 'std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>::_Eos'

Adela0814 avatar Nov 20 '23 06:11 Adela0814

this should help you: https://github.com/facebook/folly/pull/1935

pps83 avatar Nov 21 '23 01:11 pps83

@pps83 Thanks for your help, I still encountered the same error after applying your patch.

Adela0814 avatar Nov 21 '23 03:11 Adela0814

what VS version do you use (what's the value of _MSC_VER?) That's the part that I had to add to fix exactly the same error that you have when I updated to latest VS 2022: https://github.com/facebook/folly/pull/1935/files#diff-d3b374d501f30f3ff55c06a64643ae8b2a03c6d274fc65bdc30b31cf4a920511R288

pps83 avatar Nov 21 '23 14:11 pps83

what VS version do you use (what's the value of _MSC_VER?) That's the part that I had to add to fix exactly the same error that you have when I updated to latest VS 2022: https://github.com/facebook/folly/pull/1935/files#diff-d3b374d501f30f3ff55c06a64643ae8b2a03c6d274fc65bdc30b31cf4a920511R288

my version is 1937.

Adela0814 avatar Nov 22 '23 10:11 Adela0814

my version is 1937.

Try that patch, but change line 288 to #if (_MSC_VER >= 1937). Or, update VS to latest, which is Version 17.8.0 now and should make it 1938.

pps83 avatar Nov 23 '23 11:11 pps83

my version is 1937.

Try that patch, but change line 288 to #if (_MSC_VER >= 1937). Or, update VS to latest, which is Version 17.8.0 now and should make it 1938.

It's works well.

@BillyONeal I noticed that you have different commit, do you have different opinions on this fix? If not, I will apply this patch to VCPKG.

Adela0814 avatar Nov 27 '23 02:11 Adela0814

@BillyONeal I noticed that you have different commit, do you have different opinions on this fix? If not, I will apply this patch to VCPKG.

Your patch is more extensive than I was comfortable doing in vcpkg; there I just backed off to plain resize when the condition happens. Notably I didn't fix the asan problem.

Without explicit approval from upstream I wanted to be as conservative as possible in just keeping it building

BillyONeal avatar Nov 28 '23 18:11 BillyONeal