ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
329 stars 44 forks source link

Build opencv failed use v14.0 toolset #46

Closed waruqi closed 3 years ago

waruqi commented 3 years ago
       - uses: ilammy/msvc-dev-cmd@v1
         with:
          arch: ${{ matrix.arch }}
          toolset: 14.0

https://github.com/xmake-mirror/build-artifacts/runs/3065402363?check_suite_focus=true

67>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'WINDOWSSDKVERSION' Key being added: 'WindowsSDKVersion' [C:\Users\runneradmin\AppData\Local.xmake\cache\packages\2107\o\opencv\4.5.2\source\opencv-4.5.2\build\ZERO_CHECK.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB6001: at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)

ilammy commented 3 years ago

I'd guess this is an another example of an environment variable that causes conflict when it's set? Or is it just OpenCV doing its own detection and configuration of MSVC?..

pzhlkj6612 commented 3 years ago

FYI, Search · Invalid command line switch for "cmd.exe" shows that there may be some bugs in MSBuild...

waruqi commented 3 years ago

Okay thank you. I have given up using 2015 on action, and github has not installed the complete msbuild/v14.0

pzhlkj6612 commented 3 years ago

Hi, @waruqi . Did you try to runs-on "windows-2016"? I found that the MSBuild versions are not the same on different runners.

Virtual Environment Package Version
windows-2019@win19/20210711.1 Microsoft.Component.MSBuild 16.5.29515.121
windows-2016@win16/20210711.1 15.7.27520.0
waruqi commented 3 years ago

I will try it, thanks