conan安装在名称和版本字段上失败



相关文件: . ├── bin ├── src ├── conanfile.py └── gcc-9.3.0-linux-x86-debug.profile

当尝试从bin文件夹运行以下命令时,我得到的错误是在配置文件中找不到名称和版本字段。$ conan install .. --profile ../gcc-9.3.0-linux-x86-debug.profile ERROR: Error reading '../gcc-9.3.0-linux-x86-debug.profile' profile: Specify the 'name' and the 'version'

但如果我理解正确的话,版本和名称应该在conanfile.py文件中定义。在哪里可以定义install命令缺少的名称和版本号?

相关conan配置文件

[build_requires]
cmake
ninja
gcc/9.3.0
g++/9.3.0
xorriso
qemu

[settings]
os=Linux
os_build=Linux
arch=x86
arch_build=x86
compiler=gcc
compiler.version=9.3.0
cppstd=17
build_type=Debug
[options]
[env]
CC=/usr/bin/gcc-9.3.0
CXX=/usr/bin/g++-9.3.0
CFLAGS=-g
CXXFLAGS=-g

您也需要在[build_requires]中指定版本(在conanfile.txtconanfile.py文件中相同(。仅指定名称是无效的语法。所以类似于:

[build_requires]
cmake/3.16.4

如果您需要它,版本范围是可能的,例如cmake/[>3.15]之类的东西应该可以工作。

最新更新