macos - 安装 CPAN 模块时如何指定外部库文件位置

标签 macos perl cpan

我试图让 Perl 的 Finance::Quote 模块在 MacOS 升级到 11.4 后工作。依赖项之一是 B::Keywords。 B::Keywords 安装未通过测试并出现以下错误:

> sudo cpan B::Keywords
[...]
Can't open /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h: No such file or directory at t/11keywords.t line 25
挖掘了一下,我发现我的系统上的关键字.h 存在于这个位置:/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h有没有办法告诉 cpan(或 cpanm,或其他一些安装工具)在哪里寻找这些头文件?或者,欢迎使用任何其他方法来完成这项工作。

最佳答案

好像他们删除了 keywords.h来自 CORE macOS 10.14 上系统 perl 的目录(相对于 $Config{archlibexp} 给出的路径),参见 this错误报告。
无法安装的原因B::Keywords是由于测试失败11keywords.t见第 24 行。一些可能的解决方案:

  • 在不运行测试的情况下安装模块 (sudo cpan -T B::Keywords)
  • Submit an issue在 GitHub 问题跟踪器上,以便模块的作者可以解决问题。
  • 使用 perlbrew 安装模块而不是使用系统 perl(我对此进行了测试,并且在这里运行良好)。
  • 关于macos - 安装 CPAN 模块时如何指定外部库文件位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68211821/

    相关文章:

    c++ - mac上编译CGAL程序,使用macports安装

    objective-c - 将 NSURL 转换为本地文件路径

    macos - OpenGL 无法在 macOS Mojave 上渲染

    perl - Perl 中的核心、供应商和站点位置有什么区别?

    swift - 如何让我的菜单栏应用程序在登录时启动?

    linux - 系统调用接口(interface)到/proc信息

    Perl 目录、文件排序、带大小和日期的打印列表

    Perl 封装类变量?

    perl - 为什么要将 `#!/usr/bin/false` 放在 Perl 模块中?

    perl - 如何创建带有额外捆绑模块的可移植草莓?