Project

General

Profile

Actions

Emulator Issues #11773

closed

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

Added by QuellaZhang almost 5 years ago. Updated almost 5 years 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]


Files

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

Updated by Stenzek almost 5 years ago

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

Actions #2

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.

Actions #3

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.

Actions #4

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

Actions #5

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

Actions #6

Updated by JosJuice almost 5 years ago

  • Status changed from New to Fix pending
  • Milestone set to Current
Actions #7

Updated by JosJuice almost 5 years ago

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

Also available in: Atom PDF