You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cygwin环境下Perl无法加载DLL求助:疑路径转换失效

Cygwin环境下Perl脚本无法加载DLL的问题

我突然无法在Cygwin环境下运行任何Perl脚本,每次执行都会出现如下崩溃报错:

phil@TAICHI /cygdrive/h/bakE/new/virChecked
$ findFiles -s . -t /cygdrive/D/data-comp/text -u /cygdrive/E/new/virChecked/text -d -a .3
Can't load '/home/phil/perl5/lib/perl5/x86_64-cygwin-threads-multi/auto/Win32/File/File.dll' for module Win32::File: No such file or directory at /usr/lib/perl5/5.36/x86_64-cygwin-threads/DynaLoader.pm line 206.
 at /usr/local/bin/findFiles line 24.
Compilation failed in require at /usr/local/bin/findFiles line 24.
BEGIN failed--compilation aborted at /usr/local/bin/findFiles line 24.

phil@TAICHI /cygdrive/h/bakE/new/virChecked
$ pushd /home/phil/perl5/lib/perl5/x86_64-cygwin-threads-multi/auto/Win32/File/
~/perl5/lib/perl5/x86_64-cygwin-threads-multi/auto/Win32/File /cygdrive/h/bakE/new/virChecked

phil@TAICHI ~/perl5/lib/perl5/x86_64-cygwin-threads-multi/auto/Win32/File
$ ls -l File.dll
-r-xr-xr-x 1 phil None 178K Jul 14  2021 File.dll*

有时Perl无法加载File.dll,有时则无法加载IO.dll。无论哪种情况,DLL文件都确实位于Perl查找的路径中,且具备全局读取权限,但Perl始终无法加载它。

DynaLoader.pm的第206行代码为:

my $libref = dl_load_file($file, $flags) or croak("Can't load '$file' for module $module: ".dl_error());

DynaLoader开头附近有一条注释:

The load function that dl_load_file() calls may require an absolute pathname.

我找不到dl_load_file()的定义位置,它不在DynaLoader.pm中;DynaLoader仅引入了Config模块,该模块中也没有dl_load_file(),且未引入其他文件。

我怀疑是某个Perl模块发生变更,导致dl_load_file无法将Cygwin绝对路径转换为Windows绝对路径。我尝试重新安装Perl 5.36.3-1,但无济于事;我还新建了一个Cygwin安装并安装了Perl 5.40,问题依旧。

现提出以下问题:

  • 目前是否有人能够使用最新Cygwin软件包中的Perl?
  • 近期可能发生了哪些变更,导致Cygwin Perl无法使用完整的Cygwin路径?
  • 在哪里可以找到Perl 5.32版本之前的Cygwin发行版?

附言(10月13日添加):我收到了很多评论,但至今无人回答“是否拥有可用的Cygwin Perl版本”这个简单问题。如果您有可用的最新版Cygwin Perl,请告知。


内容的提问来源于stack exchange,提问作者Phil Goetz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 10:53:14