简体   繁体   English

如何更新 windows SDK 在 Github 操作上的`windows-latest`

[英]How to update windows SDK on `windows-latest` on Github Action

On a local Win-10 VM, my build succeed but not on GitHub actions ( https://github.com/dilawar/Smoldyn/runs/2636566648?check_suite_focus=true ).在本地 Win-10 VM 上,我的构建成功,但在 GitHub 操作上没有成功( https://github.com/dilawar/Smoldyn/runs/2636566648?check_suite_focus=true )。 The only difference b/w GitHub action and my local machine is the Windows SDK version: on my local machine it is 10.0.18336.0 while on Github it is 10.0.17763 . The only difference b/w GitHub action and my local machine is the Windows SDK version: on my local machine it is 10.0.18336.0 while on Github it is 10.0.17763 .

I am getting the following error at Github Action我在 Github Action 处收到以下错误

2021-05-21T05:54:42.5572172Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\wtypes.h(745): message : in expansion of macro '_VARIANT_BOOL' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5771590Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(487,17): error C2059: syntax error: '/' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5775983Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(502,17): warning C5103: pasting '/' and '/' does not result in a valid preprocessing token [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5781668Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\wtypes.h(745): message : in expansion of macro '_VARIANT_BOOL' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5784135Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(502,17): error C2059: syntax error: '/' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5786253Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(530,17): error C2059: syntax error: '}' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5787985Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(531,13): error C2059: syntax error: '}' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5789635Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(533,9): error C2059: syntax error: '}' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5791292Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(534,5): error C2059: syntax error: '}' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5793201Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(665,16): error C2079: 'varDefaultValue' uses undefined struct 'tagVARIANT' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.5795324Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\oaidl.h(950,16): error C2079: 'varValue' uses undefined struct 'tagVARIANT' [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]
2021-05-21T05:54:42.6072200Z C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\propidlbase.h(319,24): warning C5103: pasting '/' and '/' does not result in a valid preprocessing token [D:\a\Smoldyn\Smoldyn\build\source\libSteve\Steve.vcxproj]

https://github.com/microsoft/vcpkg/issues/15035#issuecomment-742427969 suggests updating the SDK version which goes well with my experience. https://github.com/microsoft/vcpkg/issues/15035#issuecomment-742427969建议更新符合我经验的 SDK 版本。

How to update windows SDK on github actions on windows-latest ?如何在windows-latest上更新 github 操作上的 windows SDK 操作?

https://github.com/ssandrews/Smoldyn/pull/72/files#diff-5ce5c9ff86f58b1f87b35b5227b2e84cb69f022d6741e1854f3e1e181091773c shows the changes I made to fix this. https://github.com/ssandrews/Smoldyn/pull/72/files#diff-5ce5c9ff86f58b1f87b35b5227b2e84cb69f022d6741e1854f3e1e181091773c显示了我对此修复所做的更改。

In short, passing -D-DCMAKE_SYSTEM_VERSION=10.0.19041.0 fixed the issue.简而言之,通过-D-DCMAKE_SYSTEM_VERSION=10.0.19041.0解决了这个问题。 Before that, I had to enable this action as suggested by @GuiFalourd in the comment above.在此之前,我必须按照上面评论中@GuiFalourd 的建议启用此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM