Project

General

Profile

Emulator Issues #11773

Dolphin failed to build due to error C2664 with MSVC on windows

Added by QuellaZhang 7 months ago. Updated 7 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Current
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
Yes
Regression start:
Fixed in:
5.0-10566

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:
1. git clone https://github.com/dolphin-emu/dolphin.git D:\Dolphin\src
2. git submodule init
3. git submodule update --recursive
4. Open a VS 2017 x64 command prompt and browse to D:\Dolphin
5. devenv /upgrade .\source\dolphin-emu.sln
6. 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]

log_x64_build.log (151 KB) log_x64_build.log build_log QuellaZhang, 06/21/2019 10:28 AM

History

#1 Updated by Stenzek 7 months ago

Thanks for bisecting. Are you using VS2017 15.7 as the commit specifies is now required?

#2 Updated by JosJuice 7 months 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.

#3 Updated by JosJuice 7 months 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.

#4 Updated by JosJuice 7 months ago

  • Relates to maintainability changed from No to Yes

Could you test this pull request? https://github.com/dolphin-emu/dolphin/pull/8213

#5 Updated by QuellaZhang 7 months 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

#6 Updated by JosJuice 7 months ago

  • Milestone set to Current
  • Status changed from New to Fix pending

#7 Updated by JosJuice 7 months ago

  • Fixed in set to 5.0-10566
  • Status changed from Fix pending to Fixed

Also available in: Atom PDF