Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Error #196

Open
LukeMouse opened this issue Dec 20, 2023 · 4 comments
Open

Compile Error #196

LukeMouse opened this issue Dec 20, 2023 · 4 comments

Comments

@LukeMouse
Copy link
Contributor

No description provided.

@LukeMouse LukeMouse changed the title Compile Compile Error Dec 20, 2023
@LukeMouse
Copy link
Contributor Author

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

@jwillemsen
Copy link
Member

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

@LukeMouse
Copy link
Contributor Author

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
Copy link
Contributor Author

LukeMouse commented Dec 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants