如何链接库来手动编译/安装 Perl 模块?

发布于 2024-09-11 04:32:26 字数 464 浏览 3 评论 0原文

我想编译/安装一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

回忆凄美了谁 2024-09-18 04:32:26

编辑 Makefile.PL 并在 WriteMakefile 调用中添加或编辑 INC 和/或 LIBS 参数。请参阅 ExtUtils::MakeMaker 文档预期的格式。这些将被传递给编译器和链接器。

Edit your Makefile.PL and add or edit the INC and/or LIBS parameters in the WriteMakefile call. See the ExtUtils::MakeMaker docs for the expected format. These will be passed to the compiler and linker.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文