How to install vcpkg on windows 7 64-bit?

2.3k views Asked by At

I tried to import some Linux C code into Windows. The editor I use is Visual Studio Code, but #include is not working.

The possible solution is install vcpkg to manage the missing libraries and include files. I downloaded vcpkg installation package from https://github.com/microsoft/vcpkg. Then I run bootstrap-vcpkg.bat in cmd.exe. The error is:

C:\study\vcpkg\vcpkg-master\toolsrc\windows-bootstrap\vcpkg.vcxproj(25,3): error MSB4019: The imported project “C:\Program Files (x86)\Microsoft Visual Studio\2019
\Community\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Default.props” was not found. Confirm that the path “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\\Microsoft.Cpp.Default.props” declaration is correct, and that the file exists on disk.
Write-Error : Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++.
所在位置 C:\study\vcpkg\vcpkg-master\scripts\bootstrap.ps1:410 字符: 16+     Write-Error <<<<  "Building vcpkg.exe failed. Please ensure you have inst
alled Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." + CategoryInfo: NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Microsoft.PowerShell.Commands.WriteErrorCommand ScriptHalted
所在位置 C:\study\vcpkg\vcpkg-master\scripts\bootstrap.ps1:411 字符: 10 + throw <<<< + CategoryInfo : OperationStopped: (:) [], RuntimeException + FullyQualifiedErrorId : ScriptHalted

As it describe, Microsoft.Cpp.Default.props was not found. So I tried to install the visual studio 2019 community as some Google answers. After installation, I retried the steps above. But the same error occurs.

Can anyone helps to solve this problem ? I guess I may miss some settings or packages of Visual Studio Code.

1

There are 1 answers

0
mohammad madani On

The bootstrap-vcpkg.bat need visual studio to create vcpkg.exe.

Are you sure the visual studio was installed in your system?

The vcpkg need:

  1. Visual Studio with the Desktop C++ workload
  2. Windows SDK for Desktop C++(for example windows SDK 8.1 or later)