【问题标题】:cygwin perl error cannot load expat.dllcygwin perl 错误无法加载 expat.dll
【发布时间】:2012-05-29 09:18:14
【问题描述】:
c:\>perl -de 1

Loading DB routines from perl5db.pl version 1.32
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   1
  DB<1> require XML::Parser::Expat
Can't load '/usr/lib/perl5/vendor_perl/5.10/i686-cygwin/auto/XML/Parser/Expat/Expat.dll' for module XML::Parser::Expat: No such file or directory at /usr/lib
/perl5/5.10/i686-cygwin/DynaLoader.pm line 200.
 at (eval 5)[/usr/lib/perl5/5.10/perl5db.pl:638] line 2
Compilation failed in require at (eval 5)[/usr/lib/perl5/5.10/perl5db.pl:638] line 2.

  DB<2> q

c:\>

有人遇到过这种情况吗?如何解决?我的cygwin位于C:\cygwin

没有目录C:\cygwin\usr\lib,但有C:\cygwin\lib。当我打开bash 并尝试cd /usr/lib 它成功(令人惊讶)并且在ls 之后似乎内容与目录C:\cygwin\lib 相同。

也就是说,目录C:\cygwin\lib\perl5\vendor_perl\5.10\i686-cygwin\auto\XML\Parser\Expat 包含一个名为Expat.dll 的文件。

cygwin 好像说找不到这个文件,但是怎么能找到/usr/lib/perl5/5.10/i686-cygwin/DynaLoader.pm

我尝试过chmod +x,但这并不能解决问题。

有什么帮助吗?

在命令行上执行perl -MXML::Parser::Expat -e1会返回:

c:\dev\trunk\src>perl -MXML::Parser::Expat -e1
Can't load '/usr/lib/perl5/vendor_perl/5.10/i686-cygwin/auto/XML/Parser/Expat/Expat.dll' for module XML::Parser::Expat: No such file or directory at /usr/lib
/perl5/5.10/i686-cygwin/DynaLoader.pm line 200.
 at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.

编辑: 另外,当我在 cygwin bash 环境中(不是直接在 cmd 中)做同样的事情时,没有错误!

【问题讨论】:

  • 在 Cygwin shell 中尝试perl -MXML::Parser::Expat -e1。另外,当你在cmd.exe 命令行上只说perl 时,它是哪一个?

标签: perl windows-7 cygwin expat-parser


【解决方案1】:

首先进入 cygwin bash shell,然后做任何我想做的事情不会给出这个错误。 因此,我建议将 bat 脚本的所有 perl 命令移至 shell 脚本并使用 bash 调用它。

【讨论】:

    猜你喜欢
    • 2020-03-29
    • 2016-04-22
    • 1970-01-01
    • 2017-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多