<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shiyu Tang的财经博客 &#187; cURL</title>
	<atom:link href="http://www.shiyutang.com/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shiyutang.com</link>
	<description>有关我的投资、生活以及爱好</description>
	<lastBuildDate>Mon, 19 Jul 2010 15:10:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Simple Guide to Let Win32 libcurl and Perl WWW::Curl Work Together</title>
		<link>http://www.shiyutang.com/2008/07/04/a-simple-guide-to-let-win32-libcurl-and-perl-wwwcurl-work-together/</link>
		<comments>http://www.shiyutang.com/2008/07/04/a-simple-guide-to-let-win32-libcurl-and-perl-wwwcurl-work-together/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 16:59:33 +0000</pubDate>
		<dc:creator>Shiyu Tang</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.shiyutang.com/2008/07/04/a-simple-guide-to-let-win32-libcurl-and-perl-wwwcurl-work-together/</guid>
		<description><![CDATA[After several hours&#8217; work, I have finally found out how to make a compiled libcurl downloaded from cURL website and the perl module WWW::Curl work together. I hope it would be useful for you. I have already installed MinGW and ActiveState Perl 5.10. Not everyone likes to compile libcurl. It is very boring and time [...]]]></description>
			<content:encoded><![CDATA[<p>After several hours&#8217; work, I have finally found out how to make a compiled libcurl downloaded from cURL website and the perl module WWW::Curl work together. I hope it would be useful for you. I have already installed MinGW and ActiveState Perl 5.10.</p>
<p>Not everyone likes to compile libcurl. It is very boring and time comsuming. Using a compiled libcurl can save some time. So I downloaded Win32 Generic libcurl compiled by Günter Knauf from <a href="http://curl.haxx.se/download.html" target="_blank">http://curl.haxx.se/download.html</a> . The link is <a href="http://www.gknw.net/mirror/curl/win32/curl-7.18.2-devel-mingw32.zip" target="_blank">http://www.gknw.net/mirror/curl/win32/curl-7.18.2-devel-mingw32.zip</a> . I guess it is compiled by MinGW.</p>
<p>If you try to perl Makefile.PL and make, of course it would fail. So I change something in Makefile.PL.</p>
<p>1. Comment &#8220;<code>requires_external_bin       'curl-config'</code>&#8220;, that means add a &#8220;#&#8221;<br />
before the line;<br />
2. Comment <code>/usr/include</code>, <code>/usr/local/curl/include</code>, <code>/usr/local/include/curl</code>, <code>../../include</code>, <code>../curl/include</code> in &#8220;<code>my @includes</code>&#8220;;<br />
3. Change &#8220;<code>C:\\INCLUDE\\CURL</code>&#8221; in &#8220;<code>my @includes</code>&#8221; to the directory like &#8220;<code>E:\\Perldev\\downloader\\curl-7.18.2-devel-mingw32\\include</code>&#8220;. <code>E:\\Perldev\\downloader</code> is the directory where you decompress the curl-7.18.2-devel-mingw32.zip to;<br />
4. Comment &#8220;<code>my $cflags = `curl-config --cflags`</code>&#8220;, &#8220;<code>my $lflags = `curl-config --libs`</code>&#8220;, &#8220;<code>my $libcurl_version = `curl-config --version`</code>&#8221; and &#8220;<code>print "version is $libcurl_version"</code>&#8220;;<br />
5. Add these lines to the place where step 4 does:</p>
<pre>my $cflags = '-I"E:\\Perldev\\downloader\\curl-7.18.2-devel-mingw32\\include"';
my $ldflags = '-L"E:\\Perldev\\downloader\\curl-7.18.2-devel-mingw32\\lib"';
my $lflags = '-lcurl -lcurldll';</pre>
<p>6. Comment these lines:</p>
<pre>if (!defined($lflags)) {
$lflags="-lcurl";
# Windows version of libcurl - not widely tested, feedback welcome!
if ($^O eq 'MSWin32') {
foreach my $try (@includes) {
if (-f $try . '\lib\libcurl_imp.lib') {
$lflags = $try . '\lib\libcurl_imp.lib' unless(-f $lflags);
last;
}
}
$lflags="libcurl.lib" unless ($lflags);
}
print "Guessing your linker flags as: $lflags\n";
}</pre>
<p>7. At the end of this file, please change &#8220;<code>'LIBS'         =>$lflags</code>&#8221;<br />
to &#8220;<code>'LIBS'         =>"$ldflags $lflags"</code>&#8220;;<br />
8. Save the file;<br />
9. perl Makefile.PL;<br />
10. nmake (you need nmake from Mircosoft, which can be downloaded from<br />
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084" target="_blank">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084</a> );<br />
11. nmake install.</p>
<p>OK, it&#8217;s done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shiyutang.com/2008/07/04/a-simple-guide-to-let-win32-libcurl-and-perl-wwwcurl-work-together/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
