我试图让 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
) 关于macos - 安装 CPAN 模块时如何指定外部库文件位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68211821/