【问题标题】:Installing Curl for Perl (WWW::Curl::Easy) on Windows在 Windows 上安装 Curl for Perl (WWW::Curl::Easy)
【发布时间】:2015-04-15 07:08:55
【问题描述】:

我在 Windows 上运行 Strawberry Perl,需要使用 WWW::Curl::Easy。 但是“抱歉,Windows 上没有可用的自动安装”。

CPAN 上有一个 README.Win32:

Installation on Windows need to be done manually, by editing Makefile.PL.

1. Specify your curl include directory on the line "my @include = qw()".
2. Specify the following parameters on the line below, where <DIR> is your curl directory like this:

my ($cflags,$ldflags,$lflags) = ('-I"<DIR>\\include"', '-L"<DIR>\\lib"','-lcurl -lcurldll');

<DIR> can be for example: "E:\\Perldev\\downloader\\curl-7.18.2-devel-mingw32" (without quotes);
3. Save Makefile.PL.
4. Execute "perl Makefile.PL";
5. Execute "nmake" ( you may need nmake from Mircosoft, which can be downloaded from http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084 );
6. Execute "nmake install".

很遗憾,我不明白我需要怎么做。我想dmake而不是nmake应该是可能的,对吧?不同的“包含目录”是什么意思?

目前采取的步骤:

  • 安装草莓perl
  • 使用 ssl 下载并解压 libcurl(curl-7.40.0-devel-mingw32.zip)
  • 从 CPAN 下载并提取 WWW::Curl
  • 编辑 Makefile.pl

    -#my @includes = qw();
    +我的@includes = qw(C:\Strawberry\curl-7.40.0-devel-mingw32\include);
    -#my ($cflags,$lflags, $ldflags) = ('','','');
    +my ($cflags,$ldflags,$lflags) = ('-I"C:\Strawberry\curl-7.40.0-devel-mingw32\include"', '-L"C:\Strawberry\curl-7.40. 0-devel-mingw32\lib"','-lcurl -lcurldll');
    ...
    -#replace open(H_IN, "-|", "gcc $curl_h");
    +open(H_IN, "|gcc $curl_h");

  • 编辑 curl.xs(工作进行中)

有人可以举例说明安装步骤吗?

非常感谢任何帮助!谢谢。

【问题讨论】:

    标签: windows perl curl


    【解决方案1】:

    回答您的问题:

    dmake 是 GNU make 的一个端口,并不是微软的 nmake 的替代品,我会按照说明使用 nmake。

    通过不同的包含目录,我假设您引用了包含 -I&lt;DIR&gt;\\include$cflags 变量以及包含相同路径的 @include 数组 - 正如 README.Win32 文件所指示的那样。

    阅读Makefile.PL,我可以看到@include实际上是由$cflags变量填充的,因此我认为没有理由同时修改@include$cflags,尽管在同时在这两个地方指定你的路径也没有什么坏处。

    最终搜索@include数组,如果找到包含curl头文件/curl/curl.h的目录,则用于构建perl模块。

    给出的说明是所有应该需要的,请说明你当前的错误,说明没有提到编辑curl.xs你在这个文件上做什么工作?

    顺便说一句,我不知道您的要求是什么,但我发现LWP::Useragent 模块更易于跨平台安装,并且提供了WWW:Curl::Easy 的大部分(如果不是全部)功能等等。

    如果您仍然遇到问题,请提供您在问题中收到的错误的详细信息。

    祝你好运。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 2010-09-15
      • 1970-01-01
      • 2013-07-25
      • 1970-01-01
      • 2015-12-09
      • 2011-04-14
      相关资源
      最近更新 更多