vcpkg install polyclipping:x64-windows Could not locate a manifest (vcpkg.json) above the current working directory. This vcpkg distribution does not have a classic mode instance.

发布时间 2023-11-15 17:37:38作者: 槑孒

错误信息表明 vcpkg 在当前工作目录及其父目录中找不到 vcpkg.json 文件,因此无法确定要安装的库。

这可能是因为你执行 vcpkg install 命令的位置不在包含 vcpkg.json 文件的项目目录中。

以下是解决方法:

  1. 确保在包含 vcpkg.json 的项目目录中运行命令:

    • 打开一个命令行终端。
    • 切换到包含 vcpkg.json 文件的项目目录。
    • 运行 vcpkg install polyclipping:x64-windows
  2. 在没有 vcpkg.json 文件的情况下使用 vcpkg install

    • 如果你不想使用 vcpkg.json 文件,可以在命令中直接指定要安装的库,而无需依赖项目目录中是否存在 vcpkg.json 文件。例如:

      .\vcpkg install polyclipping:x64-windows
      

    请注意,这种方法可能不会将库添加到项目的依赖项中,因此你可能需要手动配置项目文件来包含所需的库。

确保你正在正确的项目目录中运行 vcpkg 命令,并确保目录中包含 vcpkg.json 文件或者在命令中直接指定要安装的库。