MPC icon indicating copy to clipboard operation
MPC copied to clipboard

Compile Error

Open LukeMouse opened this issue 1 year ago • 4 comments

LukeMouse avatar Dec 20 '23 14:12 LukeMouse

in the template file MPC/templates/vs2017platforms.mpt it set WindowsTargetPlatformVersion = 10.0.17763.0 but my PC doesn't have Platform SDK with version 10.0.17763.0, when I generate mpc for vs2017 project script, I got compile error, I checked my MPC and found the settings above. so I tried to comment out this line under vs2017platforms.mpt and then I regenerated vs2017 project script again, when I compiled it, it said no error. A PC can install verious version of Platform SDK, The vs2017 env can set it automatically. I think specific the version of platform sdk version in the vs2017platforms.mpt is not a correct fashion, So does in the vs2019platforms.mpt

LukeMouse avatar Dec 20 '23 14:12 LukeMouse

With 2019 we set 10.0 as default, as far as I remember this didn't work with vs2017 when we tried that years ago, could you test when you change the default in vs2017platforms.mpt to 10.0

jwillemsen avatar Dec 21 '23 07:12 jwillemsen

I tried to change the default in vs2017platforms.mpt to 10.0 but it didn't work like vs2019. Also I found different version vs2017 (with different service package )should use different stategy, Under a lower version I just remove WindowsTargetPlatformVersion setting everything work fine, but when I did the same thing under the latest vs2017 I have to use WindowsTargetPlatformVersion setting;

LukeMouse avatar Dec 22 '23 15:12 LukeMouse

After referency form https://stackoverflow.com/questions/54134339/how-do-i-specify-any-windows-sdk-version-greater-than-10-0-in-a-visual-studio and may times tests, I found a solution as follow: First, Keep %MPC_ROOT%\templates\vs2017platforms.mpt as it's origin fashion. Second, Modify %MPC_ROOT%\templates\vc10.mpd and change <%if(WindowsTargetPlatformVersion)%> <WindowsTargetPlatformVersion><%WindowsTargetPlatformVersion%></WindowsTargetPlatformVersion> <%endif%> to <%if(WindowsTargetPlatformVersion)%> <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion> <TargetPlatformVersion>$(LatestTargetPlatformVersion)</TargetPlatformVersion> <%endif%> I found this change work under vs2015 vs2017 and vs2019,I think under vs2017 it's not important to setting "WindowsTargetPlatformVersion" but we should setting TargetPlatformVersion correctly.

LukeMouse avatar Dec 23 '23 16:12 LukeMouse