C++ VSCode CMake VCPKG: manifests are not enabled



我正在尝试像这个视频中那样构建supertux - c++ -项目。

我为c++和CMake安装了VS Code扩展,我正在使用GCC编译器。我克隆了VCPKG-Repository并执行了bootstrap-vcpkg.bat。之后,我运行./vcpkg integrate install并得到消息:

为vcpkg根应用了用户范围的集成。

.vscodesettings.json看起来像:

{
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "D:/_programming/_repos/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_BUILD": "ON",
}
}

然后我在我的Supertux-Project-Folder中创建了一个vcpkg.json文件并插入了必要的库:

{
"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_reposvcpkgvcpkg.exe install --triplet "x64-windows" --binarycaching访问所有这些库,但我得到以下错误消息:

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++项目中没有太多使用外部库的经验。)

清单是vcpkg的一个相对较新的特性。它允许您指定(通过vcpkg.json文件)您的依赖项是什么。旧的方式意味着vcpkg实际上没有办法通过查看项目文件夹来自动知道您的依赖项。你必须手动安装它们。

舱单模式默认不启用。可以通过定义环境变量VCPKG_FEATURE_FLAGS=manifests来启用它。也可以在直接调用vcpkg:D:_programming_reposvcpkgvcpkg.exe install --feature-flags=manifests,binarycaching --triplet "x64-windows"时启用。

相关内容

  • 没有找到相关文章

最新更新