开发者

I'm confused about installing WWW::Curl for Perl in Cygwin

开发者 https://www.devze.com 2023-03-22 21:21 出处:网络
I have already installed Perl and libcurl using Cygwin\'s package manager. Now, I\'m trying to install WWW::Curl. I have to specify the cURL include directory in WWW::Curl\'s Makefile.PL, but I have n

I have already installed Perl and libcurl using Cygwin's package manager. Now, I'm trying to install WWW::Curl. I have to specify the cURL include directory in WWW::Curl's Makefile.PL, but I have no idea where to look for this. Thanks for your t开发者_如何学Cime.


It will try to guess automatically. If it does not work, see the README.

P.S. LWP is more convenient to use.


edit: Using your package managers own packages is often preferred when using your system perl, cygwin has a package for perl-WWW-Curl, install this package rather than building your own.

Most likely I think you are missing the libcurl-devel package. Although you mention that libcurl is installed, please ensure that libcurl-devel is installed via the cygwin package management application, and try again if required. WWW:Curl will search for the correct include path, looking for curl/curl.h, if it cannot find the file then it might be looking in the wrong places, you'll have to do a manual install:

  1. download and unpack the package from cpan
  2. read the included README file to understand this process
  3. search your cygwin installation for a file called curl/curl.h note the directory that it is in.
  4. modify the Makefile.PL so that @includes has the directory noted above included.
  5. run perl Makefile.PL
  6. run make && make install

This process is essentially the same problem as the process for a native Win32/strawberry perl install, in that it doesnt know where libcurl is located. you can check the README.Win32 file for similar instructions.

The libcurl-devel package installs the curl/curl.h file to usr/include/ which is a path that is already searched by Makefile.PL.

To however you say you have no idea where to look, locate the curl.h you can do the following:

find / -name curl.h

But be warned this could take a long time, you could try specific locations such as /usr

find /usr -name curl.h

Or even better you can look at the package contents to find the file location:

https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86%2Flibcurl-devel%2Flibcurl-devel-7.41.0-1&grep=libcurl

To echo Alexandr's answer, LWP is more convenient to use cross platform, while covering the same features, it can also do a lot more.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号