【问题标题】:Issues seen during compilation of Net::SSLeay on linux and windows在 linux 和 windows 上编译 Net::SSLeay 时出现的问题
【发布时间】:2016-06-15 03:53:25
【问题描述】:

我们从 cpan 下载了 Net::SSLeay 模块源代码,想在本地编译并使用它。我们在两种情况下面临问题。

我们需要您对几个项目的建议:

1) 我们需要使用 Net::SSLeay 模块。我们使用以下语句在 Linux x86_64 机器上编译它: perl Makefile.PL INC=-I”/include" LIBS=-L” /lib"

这会生成一个似乎没有使用 –lcrypto 选项的 Makefile。我想使用此选项,因为我们在运行时看到以下错误:

未定义符号:X509_EXTENSION_free

从下面的链接看来,我们需要包含 –lcrypto 选项。请帮助我们如何包含此选项。我尝试查看 Makefile.pl,但由于我是这个 Makefile 的新手,所以不太了解。

http://w3facility.org/question/what-is-undefined-symbol-x509_extension_free/

2) 其次,在 Windows 上构建时,我们需要包含 openssl_path,但 INC= 和 LIBS= 似乎不起作用。 Openssl 库已经存在于本地目录中。请告诉我们如何使用#perl Makefile.pl 选项包含路径。

您的建议将不胜感激。

【问题讨论】:

    标签: perl-module


    【解决方案1】:

    我不知道它是否对你有帮助,但我在尝试安装 LWP::Protocol::https 时遇到了与 Net::SSLeay 类似的问题(在我的自定义路径 /root/perl 中):

    debian:~# apt-get install libssl-dev
    debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
    Can't load '/root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay: /root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so: undefined symbol: X509_EXTENSION_free at /root/perl/lib/5.14.2/armv5tejl-linux/DynaLoader.pm line 190.
    

    按照HERE的建议,我通过这种方式手动编译Net-SSLeay-1.74解决了:

    debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# perl Makefile.PL LIBS="-L/root/perl/lib -lssl -lcrypto -lcrypt3" INC="-I/root/perl/include"
    debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make
    debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make install
    

    那么它就可以正常工作了:

    debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
    debian:~#
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-27
      • 2010-12-13
      • 1970-01-01
      相关资源
      最近更新 更多