我在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应该是可能的,对吧?不同的“包含目录”是什么意思?
到目前为止已采取的步骤:
-#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”);
有人可以举例说明安装步骤吗?
任何帮助深表感谢 !谢谢你。
最佳答案
要回答您的问题:
dmake是GNU make的端口,并且不能替代Microsoft的nmake,我会按照说明使用nmake。
通过不同的包含目录,我假设您引用的是$cflags
变量,其中包括-I<DIR>\\include
,还包括@include
数组,其中还包括相同的路径-如README.Win32
文件所指示。
阅读Makefile.PL
,我可以看到@include
实际上实际上是由$cflags
变量填充的,因此,尽管同时在两个地方指定您的路径都没有危害,但我没有理由同时修改@include
和$cflags
。
最终,搜索@include
数组,使用包含curl头文件/curl/curl.h
的目录(如果找到)的存在来构建perl模块。
给出的说明仅是需要的,请指定您当前的错误,这些说明未提及编辑curl.xs
您正在对此文件进行什么工作?
顺便说一句,我不知道您的要求是什么,但是我发现的LWP::Useragent
模块更易于跨平台安装,并提供了WWW:Curl::Easy
的大部分(如果不是全部)功能以及更多功能。
如果您仍然遇到问题,请提供问题中收到的错误的详细信息。
祝你好运。