Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Curl for Perl (WWW::Curl::Easy) on Windows

Tags:

curl

windows

perl

I am running Strawberry Perl on Windows and need to use WWW::Curl::Easy. But "Sorry, no automated install is available on Windows".

There is a README.Win32 on CPAN:

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".

Unfortunately, I do not understand how I need to do that. I guess it should be possible with dmake instead of nmake, right? What is meant by the different "include directories"?

Steps taken so far:

  • Install strawberry perl
  • Download and extract libcurl with ssl(curl-7.40.0-devel-mingw32.zip)
  • Download and extract WWW::Curl from CPAN
  • edit Makefile.pl

    -#my @includes = qw();
    +my @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");

  • edit curl.xs (work going on)

Can someone please give an example for the installation steps?

Any help is much appreciated ! Thank you.

like image 390
user2219195 Avatar asked Nov 09 '22 16:11

user2219195


1 Answers

To answer your questions:

dmake is a port of GNU make, and is not a drop in replacement for Microsoft's nmake, I would use nmake as instructed.

By different include directories I assume your referring to the $cflags variable which you include -I<DIR>\\include and also the @include array where you also include the same path - as instructed by the README.Win32 file.

Reading the Makefile.PL, I can see that the @include is actually populated by the $cflags variable anyway, as such I see no reason to modify both the @include and the $cflags, though at the same time there is no harm specifying your path in both places.

Ultimately the @include array is searched, the presence of a directory which contains the curl header file /curl/curl.h if found, is used to build the perl module.

The instructions given are all that should be needed, please specify your current error, the instructions don't mention editing curl.xs what work are you doing on this file?

As an aside, I don't know what your requirements are, but the LWP::Useragent module I find is easier to install cross platform, and provides most if not all of the functionality of WWW:Curl::Easy and more.

If you are still having problems, please provide details of the errors you are receiving in your question.

Gook Luck.

like image 107
Paul Grove Avatar answered Nov 15 '22 09:11

Paul Grove