如何链接库来手动编译/安装 Perl 模块?
我想编译/安装一个 Perl 模块,该模块依赖于一个不在 Strawberry Perl 5.12 中的库。我在 Windows 机器上使用 Strawberry 来安装模块 (Net-SSH2)。安装失败,因为它需要库 (libssh2)。我的问题类似于这个人的 http://www.perlmonks.org/bare/?node_id =814455。但我无法使用该解决方案,因为它不适用于我的 Perl 版本,更重要的是,我的互联网连接非常有限。
我下载了 libssh2 库,但我不知道如何在 Makefile.PL 中指定包含路径,以便我可以运行:
perl Makefile.PL
make
make install
我感谢任何帮助或指针。
I want to compile/install a Perl module that depends on a library that is not in Strawberry Perl 5.12. I used Strawberry on a Windows box to install the module (Net-SSH2). The installation failed because it requires the library (libssh2). My issue is similar to this guy's http://www.perlmonks.org/bare/?node_id=814455. But I cannot use that solution because it does not apply to my Perl version and more important, I have very restricted Internet connection.
I downloaded the libssh2 library, but I don't know how specify the include path in the Makefile.PL so I can run:
perl Makefile.PL
make
make install
I appreciate any help or pointer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑
Makefile.PL
并在WriteMakefile
调用中添加或编辑INC
和/或LIBS
参数。请参阅ExtUtils::MakeMaker
文档预期的格式。这些将被传递给编译器和链接器。Edit your
Makefile.PL
and add or edit theINC
and/orLIBS
parameters in theWriteMakefile
call. See theExtUtils::MakeMaker
docs for the expected format. These will be passed to the compiler and linker.Net::SSH2 包含在Strawberry Perl 的最新测试版中。另一种选择是将此存档解压到 Strawberry 的目录中 。
Net::SSH2 is included in latest beta of Strawberry Perl. Another option is to unpack this archive into Strawberry's directory.