首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >C++ VSCode CMake VCPKG:清单未启用

C++ VSCode CMake VCPKG:清单未启用
EN

Stack Overflow用户
提问于 2021-02-25 04:44:15
回答 1查看 805关注 0票数 3

我正在尝试构建Supertux-C++-项目就像在此视频..。

我为C++和CMake安装了VS代码扩展,并且我正在使用GCC编译器。我克隆了VCPKG-Repository并执行了bootstrap-vcpkg.bat..。在那之后,我跑了./vcpkg integrate install并得到了这样的信息:

对此vcpkg根目录应用了用户范围的集成。

The .vscode\settings.json看起来像这样:

代码语言:javascript
运行
复制
{
    "cmake.configureSettings": {
        "CMAKE_TOOLCHAIN_FILE": "D:/_programming/_repos/vcpkg/scripts/buildsystems/vcpkg.cmake",
        "VCPKG_BUILD": "ON",
    }
}

然后我创建了一个vcpkg.json在我的Supertux-Project-文件夹中添加了一个文件,并插入了所需的库:

代码语言:javascript
运行
复制
{
    "name": "supertux-example",
    "version": "0.0.1",
    "dependencies": [
        "sdl2",
        "sdl2-image",
        "openal-soft",
        "curl",
        "libogg",
        "libvorbis",
        "freetype",
        "glew",
        "boost-date-time",
        "boost-filesystem",
        "boost-format",
        "boost-locale",
        "boost-system"
    ]
}

现在,我尝试使用以下命令访问所有这些库:D:\_programming\_repos\vcpkg\vcpkg.exe install --triplet "x64-windows" --binarycaching

但我得到以下错误消息:

代码语言:javascript
运行
复制
Warning: manifest-root detected at D:/_programming/cpp/supertux, but manifests are not enabled.
If you wish to use manifest mode, you may do one of the following:
    * Add the `manifests` feature flag to the comma-separated environment
      variable `VCPKG_FEATURE_FLAGS`.
    * Add the `manifests` feature flag to the `--feature-flags` option.
    * Pass your manifest directory to the `--x-manifest-root` option.
If you wish to silence this error and use classic mode, you can:
    * Add the `-manifests` feature flag to `VCPKG_FEATURE_FLAGS`.
    * Add the `-manifests` feature flag to `--feature-flags`.
Error: 'install' requires at least 1 arguments, but 0 were provided

谁能告诉我如何激活清单模式,并解释这个错误的具体原因?(我没有在C++项目中使用外部库的经验。)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-02-25 05:56:10

清单是一个相对较新的功能。vcpkg..。它允许您指定(通过vcpkg.json文件)您的依赖项是什么。旧的方式意味着真的没有办法vcpkg通过查看项目文件夹自动了解您的依赖项。你必须手动安装它们。默认情况下未启用清单模式。可以通过定义环境变量来启用它VCPKG_FEATURE_FLAGS=manifests..。直接调用vcpkg时也可以启用:D:\_programming\_repos\vcpkg\vcpkg.exe install --feature-flags=manifests,binarycaching --triplet "x64-windows"

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66358575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档