Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 5

cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-latest

I am trying to use a build matrix for compiling my cmake-based project, however, when I run CI suite, I get the following error: 

 

CMake Error at CMakeLists.txt:126 (project):
Generator
Visual Studio 15 2017 Win64
could not find any instance of Visual Studio.

 

It appears as if cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-latest, specified via 

 

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]

4 Replies
Highlighted
GitHub Partner
Message 2 of 5

Re: cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-l

When you try to run your job on windows-latest, it is on a Windows Server 2019 machine.  Windows Server 2019 image doesn't install visual studio 2017 but visual studio 2019. Please refer to this document: https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners#visual-stud...

You could specify vs2019 when build your cmake project. Such as: 

cmake -G "Visual Studio 16 2019" . 

 

Highlighted
Copilot Lvl 3
Message 3 of 5

Re: cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-l

Thanks for the quick reply. I'll go ahead and test that today. 

Highlighted
Copilot Lvl 3
Message 4 of 5

Re: cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-l

@Yanjingzhu Is there a full list of available windows hosts? For that matter an exhaustive list with a cross reference betwween https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners#visual-stud... and matrix options for strategy. 

Highlighted
GitHub Partner
Message 5 of 5

Re: cmake fails to find Visual Studio generator "Visual Studio 15 2017 Win64" on windows-l

Visual studio 2017 is installed on windows server 2016. You could use windows-2016 in your matrix as windows os. 

 os: [ ubuntu-latest, windows-2016, macos-latest ]

If I misunderstood your requirement, please feel free to point me out.