简体   繁体   English

如何在 Windows 7 64 位上安装 vcpkg?

[英]How to install vcpkg on windows 7 64-bit?

I tried to import some Linux C code into Windows.我尝试将一些 Linux C 代码导入 Windows。 The editor I use is Visual Studio Code, but #include is not working.我使用的编辑器是 Visual Studio Code,但#include不起作用。

The possible solution is install vcpkg to manage the missing libraries and include files.可能的解决方案是安装vcpkg来管理丢失的库和包含文件。 I downloaded vcpkg installation package from https://github.com/microsoft/vcpkg .我从https://github.com/microsoft/vcpkg下载了 vcpkg 安装包。 Then I run bootstrap-vcpkg.bat in cmd.exe.然后我在 cmd.exe 中运行 bootstrap-vcpkg.bat。 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.正如它所描述的,没有找到 Microsoft.Cpp.Default.props。 So I tried to install the visual studio 2019 community as some Google answers.所以我尝试安装 Visual Studio 2019 社区作为一些谷歌答案。 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.我想我可能会错过一些 Visual Studio Code 的设置或包。

The bootstrap-vcpkg.bat need visual studio to create vcpkg.exe. bootstrap-vcpkg.bat 需要visual studio 来创建vcpkg.exe。

Are you sure the visual studio was installed in your system?你确定你的系统中安装了visual studio吗?

The vcpkg need: vcpkg 需要:

  1. Visual Studio with the Desktop C++ workload带有桌面 C++ 工作负载的 Visual Studio
  2. Windows SDK for Desktop C++(for example windows SDK 8.1 or later) Windows SDK for Desktop C++(例如 windows SDK 8.1 或更高版本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM