首页 > 解决方案 > 如何修复柯南包中的库依赖性

问题描述

我正在尝试用柯南安装 qt/5.14.2。使用

qt/5.14.2@bincrafters/stable

我收到

ERROR: libpq/11.5: Error in package_info() method, line 211
    self.cpp_info.components["pq"].requires.append("zlib::zlib")
    AttributeError: 'Component' object has no attribute 'requires'

好的,在 libpq/11.5 中有一个错误

我正在尝试降级到

libpq/11.4@bincrafters/stable

ERROR: Conflict in qt/5.14.2@bincrafters/stable:
    'qt/5.14.2@bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4@bincrafters/stable' requires 'zlib/1.2.11@conan/stable'.
    To fix this conflict you need to override the package 'zlib' in your root package.

顺便说一句:为什么只需要正确版本的库并需要相同的存储库是不够的?(并且需要两个不同包中的两个不同存储库以获得相同的依赖关系)

好的,我试过了

zlib/1.2.11@bincrafters/stable

WARN: libpq/11.4@bincrafters/stable: requirement zlib/1.2.11@conan/stable overridden by your conanfile to zlib/1.2.11@bincrafters/stable 
zlib/1.2.11@bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11@bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11@bincrafters/stable: Trying with 'minres'...
zlib/1.2.11@bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11@bincrafters/stable' from 'libpq/11.4@bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11@bincrafters/stable' in remotes

最后,我到达了

libpq/11.4@bincrafters/stable
zlib/1.2.11@conan/stable
qt/5.14.2@bincrafters/stable

在此之后,看起来一切正常:

Installing (downloading, building) binaries...
qt/5.14.2@bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters' 
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2@bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2@bincrafters/stable: Downloaded package revision 0

但是,安装失败

  CMake was unable to find Qt5, put qmake in your path or set
  QTDIR/QT_QMAKE_EXECUTABLE.

包下载好了,我在我的主目录的对应子目录中看到了所有组件。但是,与其他组件不同的是,在 CMake 尝试找到它之前,它并没有安装。

我错了什么?

标签: installationqt5conan

解决方案


万一柯南有什么奇怪的行为,升级吧!对我来说,使用配置清理切换 1.24.0 -> 1.28.1 修复了与 libpq/11.5 相同的问题


推荐阅读