Emulator Issues #11773
closedDolphin failed to build due to error C2664 with MSVC on windows
0%
Description
Environment:
Windows Server 2016 + VS2017 + dolphin master branch latest srouce code.
Dolphin failed to build due to error C2664:'std::basic_string,std::allocator>::basic_string(const std::basic_string,std::allocator> &)': cannot convert argument 1 from '_Ty' to 'std::initializer_list<_Elem>'.It can be first reproduced on master revision [[fab15ed]https://github.com/dolphin-emu/dolphin/commit/fab15edb53583cdc2af4bcb01f491253ce2ce069].Could you help have a look about this issue? Thanks in advance!
Steps to reproduce the behavior:
- git clone https://github.com/dolphin-emu/dolphin.git D:\Dolphin\src
- git submodule init
- git submodule update --recursive
- Open a VS 2017 x64 command prompt and browse to D:\Dolphin
- devenv /upgrade .\source\dolphin-emu.sln
- msbuild /t:Dolphin /p:Configuration=Release;Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 .\src\Source\dolphin-emu.sln /m
Actual result:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xmemory(761,82): error C2664: 'std::basic_string,std::allocator>::basic_string(const std::basic_string,std::allocator> &)': cannot convert argument 1 from '_Ty' to 'std::initializer_list<_Elem>' [D:\Dolphin\src\Source\Core\Common\Common.vcxproj]
error C2664: _Ty=std::basic_string,std::allocator> [D:\Dolphin\src\Source\Core\Common\Common.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xmemory(761,82): error C2664: ] [D:\Dolphin\src\Source\Core\Common\Common.vcxproj]
Files
Updated by Stenzek almost 5 years ago
Thanks for bisecting. Are you using VS2017 15.7 as the commit specifies is now required?
Updated by JosJuice almost 5 years ago
I believe so. There should've been an error from pch.h otherwise, because it's checking that you have 15.7.5 or newer since a year ago.
Updated by JosJuice almost 5 years ago
Okay, with some help from IRC (since I couldn't really make sense of the log myself), it seems like this is an std::u8string vs std::string problem. Does VS2017 really support u8string? I thought that wasn't until C++20... Compilation works fine on my copy of VS2017.
Updated by JosJuice almost 5 years ago
- Relates to maintainability changed from No to Yes
Could you test this pull request? https://github.com/dolphin-emu/dolphin/pull/8213
Updated by QuellaZhang almost 5 years ago
Thanks for your reply!
Our visual studio uses vs2017, but the binaries of vs are replaced with the latest binaries of vs2019. We mainly use the open source project to test the vs compiler.
We tried to build with this https://github.com/dolphin-emu/dolphin/pull/8213 and build pass.
Could you merge this pull request into the dolphin master branch?
Thanks,
Lin
Updated by JosJuice almost 5 years ago
- Status changed from New to Fix pending
- Milestone set to Current
Updated by JosJuice almost 5 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-10566