vcpkg install error:in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance
Describe the bug A clear and concise description of what the bug is. When using vcpkg install, an error occurred: in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance
Environment
- OS: Windows10,x86_64
- Compiler: Visual Studio Code
To Reproduce Steps to reproduce the behavior:
- .\vcpkg install thrift
- See error Error: in triplet x86-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance
Hi! I'm facing the same issue in a similar environment, trying to install any package. Some comments:
- Visual Studio Code is not a compiler. It is an editor that accepts a lot of extensions, enabling among many other features compiling and debugging.
- I don't know if Visual Studio Code could be considered "a complete Visual Studio instance" as the error message reads.
- Messages available from Visual Studio Code error link to https://vcpkg.io/en/index.html and propose the use of
vcpkgto install libraries for lacking headers. - Thus, I guess we are missing some step in the installation process.
Please, should modify the triplet x86-windows.cmake? How? Should we create a new one? I don't even know for that triplet if we are working in a 64bits environment.
Please, should we install and configure CMake?
Sorry, I'm a bit lost. Thanks for your help!
Visua lStudio Installer->installed version->modify-> Language package->add English package, can resolve this problem
Is this issue resolved?
I am having a similar problem. "Could not locate a complete Visual Studio instance" although it is installed. I tried to use vcpkg to install catch2. English langauge package is already installed... Any other suggestions how to resolve this? I hope it is fine I write here, I think it is the same issue...
@IJkb See https://github.com/microsoft/vcpkg-tool/pull/314.
I have the same problem, I use VS CODE to compile, but now there is a problem with installing the egin3 pakage.
@KevinShu-AEUST Please see the required Visual Studio components in https://github.com/microsoft/vcpkg-tool/pull/314.
@KevinShu-AEUST請在microsoft/vcpkg-tool#314中查看需要的Visual Studio組件。
sorry,I don't understand the solution for this post.
你可以使用這個簡單的工具來了解你的機器上的 VS 實例,你的 SDK
I should to download pkg --mgr.exe 嗎?
@KevinShu-AEUST Sorry, I don't quite understand your question! Sorry, I don't know the relevant cmd commands very well, and I'm still researching.
Please use Visual Studio Installer to install the following Visual Studio components:
- C++:
- Windows Universal C Runtime:
Microsoft.VisualStudio.Component.Windows10SDK - C++ core desktop features:
Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core - Visual Studio Build tools:
-
Microsoft.VisualStudio.Component.VC.140(for Visual Studio 2015) -
Microsoft.VisualStudio.Component.VC.Tools.x86.x64(for Visual Studio 2017 or later)
-
- MSBuild:
Microsoft.Component.MSBuild - Windows SDK (one of them):
- 8.1:
Microsoft.VisualStudio.Component.Windows81SDK - 10.0.18362:
Microsoft.VisualStudio.Component.Windows10SDK.18362 - 10.0.19041:
Microsoft.VisualStudio.Component.Windows10SDK.19041 - 10.0.20348:
Microsoft.VisualStudio.Component.Windows10SDK.20348 - 11.0.22000:
Microsoft.VisualStudio.Component.Windows11SDK.22000
- 8.1:
- ARM/ARM64:
- Visual Studio Build tools for ARM:
Microsoft.VisualStudio.Component.VC.Tools.arm - Visual Studio Build tools for ARM:
Microsoft.VisualStudio.Component.VC.Tools.arm64
- UWP:
- Visual Studio Build tools for UWP:
Microsoft.VisualStudio.ComponentGroup.UWP.VC
Edit: cmake tool in Visual Studio Installer is also needed.
Is there any solution to purely run vcpkg with the EWDK? Am not able to install VS on this machine and rely on CLion which works fine with EWDK and EWDK is sufficient to build all my projects so I would like to keep a static install out of this system.
Setting the ENV before running vcpkg doesn't work, but as far as I can tell the EWDK should have everything required to build the packages.
Error: in triplet x64-windows-static: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
The following paths were examined for Visual Studio instances:
E:\Program Files\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary/Build\vcvarsall.bat
Установка английского языка помогла
@S0PEX No, currently vcpkg needs Visual Studio core desktop features.
Error: in triplet x64-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
The following paths were examined for Visual Studio instances:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary/Build\vcvarsall.bat
Visual Studio is installed in C:\Program Files\Microsoft Visual Studio\2022 - I don't understand what is the problem?
Error: in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance The following paths were examined for Visual Studio instances: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary/Build\vcvarsall.batVisual Studio is installed in C:\Program Files\Microsoft Visual Studio\2022 - I don't understand what is the problem?
Can you please view my comment and have a try?
Thanks.
I found a solution for me installing the C++ visual studio toolchain onto my C drive worked though it doesn't work when I install Visual studio on my E drive.
@nikinov Installing Visual Studio to a non-system disk doesn't affect vcpkg, maybe because of a problem with its environment variable settings.
Same prob here :(
@HaifaBenHsouna See the required Visual Studio components in https://github.com/microsoft/vcpkg/issues/22074#issuecomment-1022840591.
Please use Visual Studio Installer to install the following Visual Studio components:
1. C++: * Windows Universal C Runtime: `Microsoft.VisualStudio.Component.Windows10SDK` * C++ core desktop features: `Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core` * Visual Studio Build tools: * `Microsoft.VisualStudio.Component.VC.140` (for Visual Studio 2015) * `Microsoft.VisualStudio.Component.VC.Tools.x86.x64` (for Visual Studio 2017 or later) * MSBuild: `Microsoft.Component.MSBuild` * Windows SDK (one of them): * 8.1: `Microsoft.VisualStudio.Component.Windows81SDK` * 10.0.18362: `Microsoft.VisualStudio.Component.Windows10SDK.18362` * 10.0.19041: `Microsoft.VisualStudio.Component.Windows10SDK.19041` * 10.0.20348: `Microsoft.VisualStudio.Component.Windows10SDK.20348` * 11.0.22000: `Microsoft.VisualStudio.Component.Windows11SDK.22000` 2. ARM/ARM64: * Visual Studio Build tools for ARM: `Microsoft.VisualStudio.Component.VC.Tools.arm` * Visual Studio Build tools for ARM: `Microsoft.VisualStudio.Component.VC.Tools.arm64` 3. UWP: * Visual Studio Build tools for UWP: `Microsoft.VisualStudio.ComponentGroup.UWP.VC`
Not worked with me
@AndroTwrpid Can you please provide the Visual Studio components list you installed and the failure output / logs?
Thanks!
@AndroTwrpid Can you please provide the Visual Studio components list you installed and the failure output / logs?
Thanks!
Sure, https://ibb.co/HpmkWQM https://ibb.co/nDT20FB
@JackBoosY I've got the required components from your list installed.
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.Static.Analysis.Tools",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
"Microsoft.VisualStudio.Component.PortableLibrary",
"Microsoft.Net.Component.4.6.1.SDK",
"Microsoft.Net.Component.4.6.1.TargetingPack",
"Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
"Microsoft.Component.ClickOnce",
"Microsoft.VisualStudio.Component.SQL.CLR",
"Microsoft.VisualStudio.Component.VisualStudioData",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.Component.ManagedDesktop.Core",
"Microsoft.Net.Component.4.5.TargetingPack",
"Microsoft.Net.Component.4.5.2.TargetingPack",
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.VisualStudio.Component.FSharp",
"Microsoft.Net.Core.Component.SDK.2.1",
"Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.1",
"Microsoft.VisualStudio.Component.IISExpress",
"Microsoft.VisualStudio.Component.TypeScript.3.1",
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
"Microsoft.VisualStudio.Component.JavaScript.TypeScript",
"Component.WebSocket",
"Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
"Component.Microsoft.VisualStudio.RazorExtension",
"Microsoft.VisualStudio.Component.SQL.ADAL",
"Microsoft.VisualStudio.Component.SQL.NCLI",
"Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime",
"Microsoft.VisualStudio.Component.Common.Azure.Tools",
"Microsoft.VisualStudio.Component.SQL.CMDUtils",
"Microsoft.VisualStudio.Component.SQL.SSDT",
"Microsoft.VisualStudio.Component.SQL.DataSources",
"Component.Microsoft.Web.LibraryManager",
"Microsoft.VisualStudio.ComponentGroup.Web",
"Microsoft.VisualStudio.Component.DockerTools.BuildTools",
"Microsoft.VisualStudio.Component.DockerTools",
"Microsoft.VisualStudio.Component.VC.CoreIde",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Graphics.Win81",
"Microsoft.VisualStudio.Component.Graphics.Tools",
"Microsoft.VisualStudio.Component.VC.DiagnosticTools",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
"Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
"Microsoft.Component.VC.Runtime.UCRTSDK",
"Microsoft.VisualStudio.Component.Windows81SDK",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81",
"Microsoft.VisualStudio.Component.VC.ATLMFC",
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Component.FSharp.WebTemplates",
"Microsoft.NetCore.ComponentGroup.Web.2.1",
"Microsoft.VisualStudio.Component.Windows10SDK",
"Microsoft.VisualStudio.Component.TestTools.Core",
"Microsoft.VisualStudio.Workload.NetCoreTools"
]
}
Running vcpkg install from inside the actual x64 Native Tools Command Prompt for VS 2017, it still complains it can't find it lol:
C:\Users\kwu\repos\vcpkg>vcpkg install aws-sdk-cpp[s3,sqs]:x64-windows-static-vc141
Computing installation plan...
The following packages will be built and installed:
* aws-c-auth[core]:x64-windows-static-vc141 -> 0.6.3#2
* aws-c-cal[core]:x64-windows-static-vc141 -> 0.5.12#2
* aws-c-common[core]:x64-windows-static-vc141 -> 0.6.9#2
* aws-c-compression[core]:x64-windows-static-vc141 -> 0.2.14#2
* aws-c-event-stream[core]:x64-windows-static-vc141 -> 0.2.7#2
* aws-c-http[core]:x64-windows-static-vc141 -> 0.6.5#2
* aws-c-io[core]:x64-windows-static-vc141 -> 0.10.7#2
* aws-c-mqtt[core]:x64-windows-static-vc141 -> 0.7.6#3
* aws-c-s3[core]:x64-windows-static-vc141 -> 0.1.25#2
* aws-checksums[core]:x64-windows-static-vc141 -> 0.1.11#3
* aws-crt-cpp[core]:x64-windows-static-vc141 -> 0.15.1#3
aws-sdk-cpp[core,dynamodb,kinesis,s3,sqs]:x64-windows-static-vc141 -> 1.9.160#1
* openssl[core]:x64-windows-static-vc141 -> 1.1.1n
* vcpkg-cmake[core]:x64-windows -> 2022-01-19
* vcpkg-cmake-config[core]:x64-windows -> 2022-02-06
* zlib[core]:x64-windows-static-vc141 -> 1.2.11#13
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Error: in triplet x64-windows-static-vc141: Unable to find a valid Visual Studio instance
with toolset version vc141
The following Visual Studio instances were considered:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
The following paths were examined for Visual Studio instances:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary/Build\vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools/MSVC\14.29.30037\bin/HostX86/x86\dumpbin.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools/MSVC\14.16.27023\bin/HostX86/x86\dumpbin.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary/Build\vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools/MSVC\14.16.27023\bin/HostX86/x86\dumpbin.exe
C:\Users\kwu\repos\vcpkg>dir "c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat"
Volume in drive C has no label.
Volume Serial Number is 7655-EC2B
Directory of c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build
07/01/2021 07:40 PM 9,889 vcvarsall.bat
1 File(s) 9,889 bytes
0 Dir(s) 74,271,522,816 bytes free
C:\Users\kwu\repos\vcpkg>
FWIW, here's the triplet I'm using:
C:\Users\kwu\repos\vcpkg>type triplets\x64-windows-static-vc141.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET vc141)
C:\Users\kwu\repos\vcpkg>
And vcpkg version:
C:\Users\kwu\repos\vcpkg>git rev-parse HEAD
6f827f25f74033593aee7044f9532bf3abdf7b6b
Volume in drive C has no label.
@wuziq Please set a label to your system disk then try again. See https://stackoverflow.com/questions/60422938/calling-dir-in-cmd-prints-out-volume-in-drive-c-has-no-label
Volume in drive C has no label.@wuziq Please set a label to your system disk then try again. See https://stackoverflow.com/questions/60422938/calling-dir-in-cmd-prints-out-volume-in-drive-c-has-no-label
Made no difference. I'd be surprised if it did!
C:\Users\kwu\repos\vcpkg>vcpkg install aws-sdk-cpp[s3,sqs]:x64-windows-static-vc141
Computing installation plan...
The following packages will be built and installed:
* aws-c-auth[core]:x64-windows-static-vc141 -> 0.6.3#2
* aws-c-cal[core]:x64-windows-static-vc141 -> 0.5.12#2
...
* zlib[core]:x64-windows-static-vc141 -> 1.2.11#13
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Error: in triplet x64-windows-static-vc141: Unable to find a valid Visual Studio instance
at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional"
with toolset version vc141
The following Visual Studio instances were considered:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
The following paths were examined for Visual Studio instances:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary/Build\vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools/MSVC\14.29.30037\bin/HostX86/x86\dumpbin.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools/MSVC\14.16.27023\bin/HostX86/x86\dumpbin.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary/Build\vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools/MSVC\14.16.27023\bin/HostX86/x86\dumpbin.exe
C:\Users\kwu\repos\vcpkg>dir
Volume in drive C is potato
Volume Serial Number is 7655-EC2B
Directory of C:\Users\kwu\repos\vcpkg
03/01/2022 05:23 PM <DIR> .
03/01/2022 05:23 PM <DIR> ..
03/01/2022 01:04 PM 141 .gitattributes
03/01/2022 01:04 PM <DIR> .github
03/01/2022 01:04 PM 5,559 .gitignore
...
Could you pleasee use set(VCPKG_PLATFORM_TOOLSET v141) instead of set(VCPKG_PLATFORM_TOOLSET vc141)?
Nope not environment variables
select and install "Visual C++ tools for CMake" in the Visual Studio Installer
@Ssspade Is this issue resolved?
