Vcpkg: can't install on windows 10 with vs17 and toolsets v140 + v141

Created on 14 Mar 2019  ·  44Comments  ·  Source: microsoft/vcpkg

I've installed visual studio with toolsets v140 and v141 but I get the following error -

C:\vcpkg>git reset HEAD --hard
HEAD is now at cfdc331b [darknet/yolo] new port (#5648)

C:\vcpkg>bootstrap-vcpkg.bat

Building vcpkg.exe ...

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build t
ools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 bui
ld tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-cli
ck the solution, and then selecting "Retarget solution". [C:\vcpkg\toolsrc\vcpkglib\vcpkglib.vcxproj]
C:\vcpkg\scripts\bootstrap.ps1 : Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the
Desktop C++ workload and the Windows SDK for Desktop C++.
At line:1 char:4
+ & {& 'C:\vcpkg\scripts\bootstrap.ps1' }
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,bootstrap.ps1

Capture

repro

All 44 comments

WindowsSDK ?

@Voskrese Are you trying to ask me or suggest something?

Please ensure you have installed Visual Studio with the
Desktop C++ workload and the Windows SDK for Desktop C++.

Install Windows SDK for Desktop C++

@Voskrese
Capture
Capture1
I just want to take this opportunity to say that windows sucks balls.

@sagunkho @Voskrese

DO NOT follow the README.md from https://github.com/Microsoft/vcpkg

Download the zip file directly and unzip it, you'll have a folder named vcpkg-master.

Then open the PowerShell, cd to the path vcpkg-master and bootstrap-vcpkg.bat.

image
image

@LuciousZhang Thanks but I tried your way and still the same...
Capture2

?
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -version "[15.0,16.0)"

@Voskrese

C:\>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -version "[15.0,16.0)"
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community

по скрину видно что вы используете toolset v141 в triplet
а установлен только MSVC 2015 = v140

translate google

On the screen you can see that you use the toolset v141 in triplet
MSVC 2015 = v140 only installed

@Voskrese When I didn't have MSVC 2015 (v140 toolset) installed it complained that I didn't have v140 installed. After installing it, I get this issue.

It is possible, but the error shows that the paths are ... \ v4.0 \ v140 \ Micro ...
this is from MSVC 2015

have 2017-2019 other ways to Targets MSBUILD

возможно, но в ошибке видно что пути ..\v4.0\v140\Micro...
это от MSVC 2015

у 2017-2019 другие пути к Targets MSBUILD

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets

set env

set VCPKG_VISUAL_STUDIO_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
set VS150INSTALL=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
set VS2017INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
set VSINSTALLDIR_150=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\
set VCTargetsPath15=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\

try again

@Voskrese Thanks, tried it but still the same.
Capture3

open in IDE 2017 - ..\vcpkg\toolsrc\vcpkg.sln - build

or

dirs.proj = ..\vcpkg\toolsrc\dirs.proj

msbuild /p:Configuration=Debug /p:Platform=x86 /p:PlatformToolset=v141 /target:ReBuild dirs.proj
+
/v:diag
msbuild /v:diag /p:Configuration=Debug /p:Platform=x86 /p:PlatformToolset=v141 /target:ReBuild dirs.proj

@Voskrese
Capture4
Capture5

msbuild

%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"

Capture6

default %comspec% - env = cmd.exe

echo %comspec%

open cmd.exe

PS C:\Users\sagun\Desktop\Development\vcpkg-master> echo %comspec%
%comspec%

close powershell
open cmd.exe

Ok done building the project but not sure what to do now, there's no vcpkg.exe in the root folder.

```FinalizeBuildStatus:
Deleting file "C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\msbuild.x86.debug\vcpkgmetricsuploader\vcpkgme
t.7D6FDEEB.tlog\unsuccessfulbuild".
Touching "C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\msbuild.x86.debug\vcpkgmetricsuploader\vcpkgmet.7D6
FDEEB.tlog\vcpkgmetricsuploader.lastbuildstate".
Done Building Project "C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\vcpkgmetricsuploader\vcpkgmetricsuploade
r.vcxproj" (Build target(s)).

Done Building Project "C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\dirs.proj" (ReBuild target(s)).

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:17.43
```

)) find C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc
and copy vcpkg.exe to C:\Users\sagun\Desktop\Developmentvcpkg-master

There's no vcpkg.exe in the folder
Capture7

somewhere in the subfolders, click in the upper right corner of the search and the name that you are looking for)))

ah lol :)

thanks.

@Voskrese but now...

C:\Users\sagun\Desktop\Development\vcpkg-master\toolsrc\msbuild.x86.debug>vcpkg install luajit:x64-windows
The following packages will be built and installed:
    luajit[core]:x64-windows
Starting package 1/1: luajit:x64-windows
Building package luajit[core]:x64-windows...
Could not find Visual Studio instance at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/.

not C:\Users\sagun\Desktop\Development\vcpkg-master\toolsrc\msbuild.x86.debug>vcpkg install luajit:x64-windows

still need to reinstall MSVC, apparently not enough packages
reinstall to full install with recovery

I have done that twice before ...

C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\msbuild.x86.debug>vcpkg

C:\Users\sagun\Desktop\Developmentvcpkg-master\vcpkg.exe

copy
C:\Users\sagun\Desktop\Developmentvcpkg-master\toolsrc\msbuild.x86.debug\vcpkg.exe
to
C:\Users\sagun\Desktop\Developmentvcpkg-master\vcpkg.exe

C:\Users\sagun\Desktop\Development\vcpkg-master>vcpkg install luajit:x64-windows
Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey
The following packages will be built and installed:
    luajit[core]:x64-windows
Starting package 1/1: luajit:x64-windows
Building package luajit[core]:x64-windows...
Could not find Visual Studio instance at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/.

C:\Users\sagun\Desktop\Development\vcpkg-master>

((( reinstall to full install with recovery

Ok, thanks, will update after reinstall.

@Voskrese I have removed visual studio completely, including the installer. Restarted my computer and reinstalled with same packages listed above.
Then I've re-runned all the commands above to build dirs.proj, I had to install Windows 8.1SDK. After doing that I re-run the command and now I get -

"C:\Users\sagun\Desktop\Development\vcpkg-master\toolsrc\dirs.proj" (ReBuild target) (1) ->
"C:\Users\sagun\Desktop\Development\vcpkg-master\toolsrc\vcpkglib\vcpkglib.vcxproj" (Build target) (2:4) ->
(ClCompile target) ->
  c:\program files (x86)\windows kits\8.1\include\um\winnt.h(31): fatal error C1083: Cannot open include file: 'ctype.h
': No such file or directory [C:\Users\sagun\Desktop\Development\vcpkg-master\toolsrc\vcpkglib\vcpkglib.vcxproj]

    0 Warning(s)
    1 Error(s)

do as in the instructions via bootstrap
if everything is OK, then there should be no error in the package installation

c:\program files (x86)\windows kits\8.1\include\um\winnt.h(31): fatal

but if you get confused, edit or delete this tag in all .vcxproj

<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
to
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>

or delete just <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>

or

10.0.17134.0 = ver WindowsSDK install

msbuild /v:diag /p:Configuration=Debug /p:Platform=x86 /p:PlatformToolset=v141 /p:TargetPlatformVersion="10.0.17134.0" /p:WindowsTargetPlatformVersion="10.0.17134.0" /target:ReBuild dirs.proj

@Voskrese Recompiled the project with your command but -

C:\Users\sagun\Desktop\Development\vcpkg-master>vcpkg install boost-system:x64-windows
The following packages will be built and installed:
  * boost-assert[core]:x64-windows
  * boost-build[core]:x64-windows
  * boost-compatibility[core]:x64-windows
  * boost-config[core]:x64-windows
  * boost-core[core]:x64-windows
  * boost-detail[core]:x64-windows
  * boost-integer[core]:x64-windows
  * boost-modular-build-helper[core]:x64-windows
  * boost-predef[core]:x64-windows
  * boost-preprocessor[core]:x64-windows
  * boost-static-assert[core]:x64-windows
    boost-system[core]:x64-windows
  * boost-vcpkg-helpers[core]:x64-windows
  * boost-winapi[core]:x64-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/14: boost-vcpkg-helpers:x64-windows
Building package boost-vcpkg-helpers[core]:x64-windows...
Could not find Visual Studio instance at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/.

vcpkg install boost-system:x64-windows --debug
or
vcpkg env --debug --triplet x64-windows

C:\Users\sagun\Desktop\Development\vcpkg-master>vcpkg install boost-system:x64-windows --debug
[DEBUG] Using vcpkg-root: C:\Users\sagun\Desktop\Development\vcpkg-master
The following packages will be built and installed:
  * boost-assert[core]:x64-windows
  * boost-build[core]:x64-windows
  * boost-compatibility[core]:x64-windows
  * boost-config[core]:x64-windows
  * boost-core[core]:x64-windows
  * boost-detail[core]:x64-windows
  * boost-integer[core]:x64-windows
  * boost-modular-build-helper[core]:x64-windows
  * boost-predef[core]:x64-windows
  * boost-preprocessor[core]:x64-windows
  * boost-static-assert[core]:x64-windows
    boost-system[core]:x64-windows
  * boost-vcpkg-helpers[core]:x64-windows
  * boost-winapi[core]:x64-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/14: boost-vcpkg-helpers:x64-windows
Building package boost-vcpkg-helpers[core]:x64-windows...
[DEBUG] Found path: C:\Program Files\CMake\bin/cmake.exe
[DEBUG] Found path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin/cmake.exe
[DEBUG] _wpopen(""C:\Program Files\CMake\bin/cmake.exe" --version 2>&1")
[DEBUG] _pclose() returned 0 after    59483 us
[DEBUG] _wpopen(""C:\Program Files\CMake\bin/cmake.exe" "-DCMAKE_TRIPLET_FILE=C:/Users/sagun/Desktop/Development/vcpkg-master/triplets/x64-windows.cmake" -P "C:/Users/sagun/Desktop/Development/vcpkg-master/scripts/get_triplet_environment.cmake" 2>&1")
[DEBUG] _pclose() returned 0 after    51643 us
[DEBUG] Found path: C:\Program Files\Git\cmd/git.exe
[DEBUG] _wpopen(""C:\Program Files\Git\cmd/git.exe" --version 2>&1")
[DEBUG] _pclose() returned 0 after    47862 us
[DEBUG] _wpopen(""C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products * -format xml 2>&1")
[DEBUG] _pclose() returned 0 after    39774 us
Could not find Visual Studio instance at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/.
[DEBUG] c:\users\sagun\desktop\development\vcpkg-master\toolsrc\src\vcpkg\vcpkgpaths.cpp(189)
[DEBUG] Exiting after 1124899 us (1123043 us)

"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products *

C:\Users\sagun\Desktop\Development\vcpkg-master>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products *
Visual Studio Locator version 2.5.2+gebb9f26a3d [query version 1.18.21.37008]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 53a6edbf
installDate: 3/18/2019 4:20:13 AM
installationName: VisualStudio/15.9.9+28307.518
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
installationVersion: 15.9.28307.518
productId: Microsoft.VisualStudio.Product.Community
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
isPrerelease: 0
displayName: Visual Studio Community 2017
description: Free, fully-featured IDE for students, open-source and individual developers
channelId: VisualStudio.15.Release
channelUri: https://aka.ms/vs/15/release/channel
enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
releaseNotes: https://go.microsoft.com/fwlink/?LinkId=660692#15.9.9
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660708
updateDate: 2019-03-18T11:20:13.4194944Z
catalog_buildBranch: d15.9
catalog_buildVersion: 15.9.28307.518
catalog_id: VisualStudio/15.9.9+28307.518
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 15.9.9
catalog_productLine: Dev15
catalog_productLineVersion: 2017
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 9
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productRelease: RTW
catalog_productSemanticVersion: 15.9.9+28307.518
catalog_requiredEngineVersion: 1.18.1049.33485
properties_campaignId: 1970353587.1550757011
properties_channelManifestId: VisualStudio.15.Release/15.9.9+28307.518
properties_nickname:
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe

instanceId: VisualStudio.14.0
installationPath: C:\Program Files (x86)\Microsoft Visual Studio 14.0\
installationVersion: 14.0

C:\Users\sagun\Desktop\Development\vcpkg-master>

попробуйте откатится до этой версии
https://github.com/Microsoft/vcpkg/archive/397e1a5d6c7d6a694650e3455969060005b9a6f7.zip

были изменения для интеграции MSVC 2019, возможно они повлияли

try to roll back to this version
There have been changes to the integration of MSVC 2019, perhaps they have influenced

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg

PS> .bootstrap-vcpkg.bat

build OK ???

@Voskrese Yes, finally... that works. I have pulled from git and reset to that commit. Thanks.

@sagunkho Thanks for your feedback. I have installed VS 2017 15.9.11( V141 + V140 installed), and I did not reproduce this issue anymore. Please reopen a new issue if it is still a problem for you!
Capture

Was this page helpful?
0 / 5 - 0 ratings