Vcpkg: "Could not locate a complete toolset", have English version of VS2015 installed

Created on 19 Jul 2020  路  7Comments  路  Source: microsoft/vcpkg

Many users ask about "Could not locate a complete toolset", but the only solution proposed is to install the English language pack for Visual Studio. Well, I have VS 2015 Update 3 installed, English language pack is installed (I use only English). Visual Studio is installed on my computer in C:\VS2015 directory. I was able to bootstrap and build vcpkg fine. But trying to use it, no such luck, only a cryptic message:

C:\github\vcpkg>vcpkg.exe install tesseract:x64-windows-static
Computing installation plan...
The following packages will be built and installed:

  • giflib[core]:x64-windows-static
  • leptonica[core]:x64-windows-static
  • libjpeg-turbo[core]:x64-windows-static
  • liblzma[core]:x64-windows-static
  • libpng[core]:x64-windows-static
  • libwebp[core,nearlossless,simd,unicode]:x64-windows-static
    tesseract[core]:x64-windows-static
  • tiff[core]:x64-windows-static
  • zlib[core]:x64-windows-static
    Additional packages (*) will be modified to complete this operation.
    Could not locate a complete toolset.
    The following paths were examined:

Nothing beyond that, it did not "examine" any paths... What to do?

question

All 7 comments

@gregko

  • I am not an expert by any means, but I have found in the many decades of IT work, many downstream software packages (vcpkg) do not like when upstream software packages (visual studio) it (vcpkg) depends on being installed somewhere other than the software manufacturers default location. I will note this has become better in the last 10-15 years but it is still far from optimal.
  • VCPKG unfortunately is one of them...

    • Having VS2015 installed at C:\VS2015 I would theorize vcpkg is having problems locating everything it needs to work properly.

    • Look in the source file <vcpkg-root>\toolsrc\src\vcpkg\visualstudio.cpp, vcpkg looks for many of VS2015 aka Microsoft Visual Studio 14 toolset v140 binaries within path program_files_32_bit variable, aka C:\Program Files\ on 32-bit x86 systems, or C:\Program Files (x86)\ on 64-bit x64 systems.

  • VCPKG on windows also requires the English language pack (regardless of the language the host is using) and needs the Windows SDK v8.1 or later.

Thank you, appreciate your help! Strange that they don't have some easy environment variable to set this, but hard code instead... I just modified visualstudio.cpp, line 161 line this, and now it works for me:

    // VS2015 instance from Program Files
    //append_if_has_cl_vs140(program_files_32_bit / "Microsoft Visual Studio 14.0"); - commented out
    append_if_has_cl_vs140("C:/VS2015"); // added my own dir

@gregko Do you have a vswhere.exe in C:\Program Files (x86)\Microsoft Visual Studio\Installer, and does vswhere -legacy list instanceId: VisualStudio.14.0 at installationPath: C:\VS2015\ with installationVersion: 14.0?

Regardless, what works for me to get vcpkg to locate VS 2015 in a non-default directory is add a new triplet for example x64-windows-static-v140.cmake with set(VCPKG_VISUAL_STUDIO_PATH "C:\\VS2015\\") and set(VCPKG_PLATFORM_TOOLSET v140) appended at the end.

Thank you! This is what I tried before even posting here, the only difference is aht I did not include trailing \ - I had set(VCPKG_VISUAL_STUDIO_PATH "C:\VS2015").

Thank you all for helping resolve this issue!

Thank you! This is what I tried before even posting here, the only difference is aht I did not include trailing \ - I had set(VCPKG_VISUAL_STUDIO_PATH "C:\VS2015").

Hi, can you share how to add set(VCPKG_VISUAL_STUDIO_PATH "C:\VS2015"). I install the vs2015 in D:\application\visualstudio and change to english package, but I still got thesame problem as you. So can you share the details about in which file to set the VCPKG_VISUAL_STUDIO_PATH

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oahzuw picture oahzuw  路  3Comments

spindensity picture spindensity  路  3Comments

F0I0l0I0P picture F0I0l0I0P  路  3Comments

madkoala picture madkoala  路  3Comments

angelmixu picture angelmixu  路  3Comments