Project

General

Profile

Actions

Emulator Issues #11829

closed

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

Added by QuellaZhang over 4 years ago. Updated over 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
% Done:

100%

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

Description

Environment:
Windows Server 2016 + VS2017 + dolphin master branch latest srouce code.

Dolphin failed to build due to error C2664: 'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 8 from 'bool' to 'LPBOOL. 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:
D:\Dolphin\src\Source\Core\Common\StringUtil.cpp(486): error C2664: 'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 8 from 'bool' to 'LPBOOL'
D:\Dolphin\src\Source\Core\Common\StringUtil.cpp(487): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\stringapiset.h(153): note: see declaration of 'WideCharToMultiByte'


Files

dolphin_bug965285.patch (1.32 KB) dolphin_bug965285.patch QuellaZhang, 08/14/2019 09:40 AM
Actions #1

Updated by Silent over 4 years ago

Looks like a valid error, although weird that nobody else has been getting it - possibly devenv /upgrade switches some compilation options such as maybe /permissive-.

For an immediate fix, just change this "false" to "nullptr", I'll look into fixing this properly in the source later today.

Actions #2

Updated by QuellaZhang over 4 years ago

I have attached released patch, please review it.

Actions #3

Updated by Silent over 4 years ago

That looks good to me.

Actions #4

Updated by Silent over 4 years ago

  • Assignee set to Silent
Actions #5

Updated by Silent over 4 years ago

I know you said you use VS2017, but I am unable to get the same error with VS2017 no matter what I do. Seeing how you launched /upgrade, did you by any chance not launch VS2019?

The only thing I can think of is that maybe the very latest VS2017 update (released 13.08) added this, and I did not grab it yet. I'll install it, clean the repository and try again later.

Actions #6

Updated by Silent over 4 years ago

  • Status changed from New to Fix pending
  • % Done changed from 0 to 100
  • Easy changed from No to Yes
  • Relates to maintainability changed from No to Yes
Actions #8

Updated by JosJuice over 4 years ago

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

Also available in: Atom PDF