在 Perl 中,这个错误是什么意思?
Unresolved symbol: Perl_Gthr_key_ptr
在 HP-UX PA-RISC 机器上使用 perl2exe 将 Perl 文件转换为二进制文件时出现此错误。
/usr/lib/dld.sl: Unresolved symbol: Perl_Gthr_key_ptr (code) from /tmp/p2xtmp-9979/Cwd.sl IOT trap (core dumped)
Off the top of my head it looks like a non-threaded perl trying to load modules compiled for a threaded perl.
EDIT: to clarify, you can compile Perl with support for threads (threaded perl) or without support for threads (non-threaded perl). If the module was built to be used with threads and is loaded by a perl without support for threads it usually produces the above error.
To check for thread support in perl, just search for the "thread" string in the output of perl -V
:
perl -V | grep thread
正在加载一个与基本 Perl 安装不兼容的 Perl 模块。这可能是由于以前使用 CPAN shell 安装了模块,然后使用您的操作系统包管理器在其下升级 Perl 造成的。这种情况可以通过
$ cpan -r
它将找到所有带有二进制组件的 CPAN 模块,并针对您当前安装的 Perl 重新编译这些二进制组件。