【问题标题】:conan install fails on name and version field柯南安装在名称和版本字段上失败
【发布时间】:2020-05-02 18:05:50
【问题描述】:

相关文件: . ├── 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文件中定义。我应该在哪里为安装命令定​​义缺少的名称和版本号?

相关柯南简介

[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

【问题讨论】:

    标签: linux conan


    【解决方案1】:

    您还需要在[build_requires] 中指定版本(conanfile.txtconanfile.py 文件中相同)。仅指定名称不是有效的语法。所以像:

    [build_requires]
    cmake/3.16.4
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多