I'm trying to install Openalpr on my Windows 10 (x64) laptop following this tutorial Openalpr for Windows but when I'm on the step Build a release build for x64 targeting toolchain v120 I get the following error in Windows Powershell:
Die : PlatformToolset v120 is not installed.
At C:\Users\shama_000\Google Drive\Projects\Git Projects\openalpr\windows\build.ps1:230 char:9
+ Die "PlatformToolset $PlatformToolset is not installed."
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Die
I opened the file with Notepad++ to search for the issue and it says this:
if ($VXXCommonTools -eq $null -or (-not (Test-Path($VXXCommonTools)))) {
Die "PlatformToolset $PlatformToolset is not installed."}
But at the beginning of the code, in the param
section I found this:
[ValidateSet("v100", "v110", "v120", "v140")]
So it should work for any version of PlatformToolset (or atleast that's my logic). I don't know which version I have of this Toolset but I've been searching for this error in the internet and I only find posts about Visual Studio like this one The builds tools for v120 (Platform Toolset = 'v120') cannot be found but the "solution" for this issue is to install a recent version of Visual Studio. Right now I have installed Visual Studio 2015 so, for the answers in this question, this should work already.
I was searching for Environment Variables that could mess up my build when I found that I already had this variable: VS140COMNTOOLS
.
So, when I wrote again the command in Windows PowerShell to build, just changed the PlatformToolset to v140:
.\build.ps1 -Configuration Release -Platform x64 -PlatformToolset v140 -CudaGeneration None
That worked out. The issue was that my build couldn't find any Toolset v120 because there wasn't any there, the only one was v140. So if you have the same issue, search in your Environment Variables for which PlatformToolset your computer is using and use that one.