www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Having trouble setting up libcurl on Windows 7

reply "Gavin" <wzy17695 gmail.com> writes:
How do I setup libcurl on Windows 7?
I want to use the functions from the std.net.curl module.

Here's what I did:

I downloaded the zip file from here http://curl.haxx.se/libcurl/d/
According to the instructions in the read-me file, I did as it 
said, and I copied the files to my project directory. However it 
did not work.

I can't seem to figure out what's wrong.
Mar 15 2012
next sibling parent "Gavin" <wzy17695 gmail.com> writes:
On Thursday, 15 March 2012 at 08:59:58 UTC, Gavin wrote:
 How do I setup libcurl on Windows 7?
 I want to use the functions from the std.net.curl module.

 Here's what I did:

 I downloaded the zip file from here 
 http://curl.haxx.se/libcurl/d/
 According to the instructions in the read-me file, I did as it 
 said, and I copied the files to my project directory. However 
 it did not work.

 I can't seem to figure out what's wrong.

I forgot to say I'm using Visual Studio 2010, and Visual D
Mar 15 2012
prev sibling next sibling parent reply Brad Anderson <eco gnuk.net> writes:
--e89a8f22c535b05b0704bb49d1d1
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 15, 2012 at 3:10 AM, Gavin <wzy17695 gmail.com> wrote:

 On Thursday, 15 March 2012 at 08:59:58 UTC, Gavin wrote:

 How do I setup libcurl on Windows 7?
 I want to use the functions from the std.net.curl module.

 Here's what I did:

 I downloaded the zip file from here http://curl.haxx.se/libcurl/d/
 According to the instructions in the read-me file, I did as it said, and
 I copied the files to my project directory. However it did not work.

 I can't seem to figure out what's wrong.

I forgot to say I'm using Visual Studio 2010, and Visual D

2.058 for Windows was released without std.net.curl built in. You'll have to rebuild phobos to get it working. It's not too hard though. Download this version of libcurl which has an dmd-compatible OMF curl import library. https://github.com/downloads/D-Programming-Language/dmd/curl-7.24.0-dmd-win32.zip Just drop the top level dmd2 folder right into wherever you installed D. The directory layout matches D's installation so it'll put the dlls and the import library where they need to go. Next, download a replacement for win32.mak from my branch that enables curl here: https://raw.github.com/eco/phobos/9c2f390be07927ef08a9d681924afcb90892b3cb/win32.mak Place that in D\dmd2\src\phobos\, overwriting the one that is already there. Now open a command prompt to that same directory and type: make -f win32.mak unittest The 'unittest' is optional and takes a lot longer but std.net.curl is checked so you'll get an early warning if something is wrong. Finally, copy the resulting phobos.lib from the current directory into D\dmd2\windows\lib\, overwriting the one that is there. If you want to distribute your application you'll need to include the curl dlls that are in the first download along with it. Just dropping them in the same directory as your application should work fine (although its given us trouble with the autotester which is why this pull request hasn't been merged. I'm still trying to figure out what to do about it.). Regards, Brad Anderson --e89a8f22c535b05b0704bb49d1d1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Mar 15, 2012 at 3:10 AM, Gavin <span dir=3D"ltr">&lt;<a href=3D"mai= lto:wzy17695 gmail.com">wzy17695 gmail.com</a>&gt;</span> wrote:<br><div cl= ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0= .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"HOEnZb"><div class=3D"h5">On Thursday, 15 March 2012 at 08:59= :58 UTC, Gavin wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> How do I setup libcurl on Windows 7?<br> I want to use the functions from the std.net.curl module.<br> <br> Here&#39;s what I did:<br> <br> I downloaded the zip file from here <a href=3D"http://curl.haxx.se/libcurl/= d/" target=3D"_blank">http://curl.haxx.se/libcurl/d/</a><br> According to the instructions in the read-me file, I did as it said, and I = copied the files to my project directory. However it did not work.<br> <br> I can&#39;t seem to figure out what&#39;s wrong.<br> </blockquote> <br></div></div> I forgot to say I&#39;m using Visual Studio 2010, and Visual D<br> </blockquote></div><br><div>2.058 for Windows was released without std.net.= curl built in. You&#39;ll have to rebuild phobos to get it working. It&#39;= s not too hard though.</div><div><br></div><div>Download this version of li= bcurl which has an dmd-compatible OMF curl import library. <a href=3D"https= ://github.com/downloads/D-Programming-Language/dmd/curl-7.24.0-dmd-win32.zi= p">https://github.com/downloads/D-Programming-Language/dmd/curl-7.24.0-dmd-= win32.zip</a></div> <div><br></div><div>Just drop the top level dmd2 folder right into wherever= you installed D. =A0The directory layout matches D&#39;s installation so i= t&#39;ll put the dlls and the import library where they need to go.</div> <div><br></div><div>Next, download a replacement for win32.mak from my bran= ch that enables curl here:=A0<a href=3D"https://raw.github.com/eco/phobos/9= c2f390be07927ef08a9d681924afcb90892b3cb/win32.mak">https://raw.github.com/e= co/phobos/9c2f390be07927ef08a9d681924afcb90892b3cb/win32.mak</a>=A0</div> <div><br></div><div>Place that in D\dmd2\src\phobos\, overwriting the one t= hat is already there. =A0Now open a command prompt to that same directory a= nd type:</div><div><br></div><div>=A0 =A0make -f win32.mak unittest</div><d= iv> <br></div><div>The &#39;unittest&#39; is optional and takes a lot longer bu= t std.net.curl is checked so you&#39;ll get an early warning if something i= s wrong. =A0Finally, copy the resulting phobos.lib from the current directo= ry into D\dmd2\windows\lib\, overwriting the one that is there.</div> <div><br></div><div>If you want to distribute your application you&#39;ll n= eed to include the curl dlls that are in the first download along with it. = =A0Just dropping them in the same directory as your application should work= fine (although its given us trouble with the autotester which is why this = pull request hasn&#39;t been merged. I&#39;m still trying to figure out wha= t to do about it.).</div> <div><br></div><div>Regards,</div><div>Brad Anderson</div> --e89a8f22c535b05b0704bb49d1d1--
Mar 15 2012
parent Gleb <s4mmael gmail.com> writes:
Hi guys!

Brad Anderson Wrote:
 On Thu, Mar 15, 2012 at 3:10 AM, Gavin <wzy17695 gmail.com> wrote:
 2.058 for Windows was released without std.net.curl built in. You'll have
 to rebuild phobos to get it working. It's not too hard though.

More information about the errors is in this thread: forum.dlang.org/thread/rugjkrsqbnwlzlcsvbss forum.dlang.org#post-rugjkrsqbnwlzlcsvbss:40forum.dlang.org Maybe somebody who managed to get it built correctly can share phobos.lib for Windows 7 with curl support, please?
Mar 30 2012
prev sibling next sibling parent Brad Anderson <eco gnuk.net> writes:
--f46d04083f4b377a3804bc790af8
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Mar 30, 2012 at 1:52 AM, Gleb <s4mmael gmail.com> wrote:

 Hi guys!

 Brad Anderson Wrote:
 On Thu, Mar 15, 2012 at 3:10 AM, Gavin <wzy17695 gmail.com> wrote:
 2.058 for Windows was released without std.net.curl built in. You'll have
 to rebuild phobos to get it working. It's not too hard though.

didn't manage to get it work. More information about the errors is in this thread: forum.dlang.org/thread/rugjkrsqbnwlzlcsvbss forum.dlang.org#post-rugjkrsqbnwlzlcsvbss:40forum.dlang.org Maybe somebody who managed to get it built correctly can share phobos.lib for Windows 7 with curl support, please?

Sorry for the trouble. I should have checked this before I gave you the instructions. The win32.mak replacement I offered you was actually created from HEAD, not the v2.058 tag so it included the removal of the __fileinit stuff that didn't happen until after 2.058. You can find a proper win32.mak here: https://gist.github.com/3816217ffd041d62d6bd For anyone coming across this thread from the archive, use the patch file also in the above link instead of the whole file replacement. Unfortunately 2.059 won't include the changes (I'm kind of at a loss with how to proceed) but the win32.mak differs from the 2.058 version so using the patch is necessary in order to not break things. Regards, Brad Anderson --f46d04083f4b377a3804bc790af8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Mar 30, 2012 at 1:52 AM, Gleb <span dir=3D"ltr">&lt;<a href=3D"mail= to:s4mmael gmail.com">s4mmael gmail.com</a>&gt;</span> wrote:<br><div class= =3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8= ex;border-left:1px #ccc solid;padding-left:1ex"> Hi guys!<br> <div class=3D"im"><br> Brad Anderson Wrote:<br> &gt; On Thu, Mar 15, 2012 at 3:10 AM, Gavin &lt;<a href=3D"mailto:wzy17695 = gmail.com">wzy17695 gmail.com</a>&gt; wrote:<br> </div><div class=3D"im">&gt; 2.058 for Windows was released without std.net= .curl built in. You&#39;ll have<br> &gt; to rebuild phobos to get it working. It&#39;s not too hard though.<br> </div>I tried to rebuild Phobos using the instructions from this thread, bu= t I didn&#39;t manage to get it work.<br> More information about the errors is in this thread:<br> <a href=3D"http://forum.dlang.org/thread/rugjkrsqbnwlzlcsvbss forum.dlang.o= rg#post-rugjkrsqbnwlzlcsvbss:40forum.dlang.org" target=3D"_blank">forum.dla= ng.org/thread/rugjkrsqbnwlzlcsvbss forum.dlang.org#post-rugjkrsqbnwlzlcsvbs= s:40forum.dlang.org</a><br> <br> Maybe somebody who managed to get it built correctly can share phobos.lib f= or Windows 7 with curl support, please?<br> </blockquote></div><br><div>Sorry for the trouble. =A0I should have checked= this before I gave you the instructions. =A0The win32.mak replacement I of= fered you was actually created from HEAD, not the v2.058 tag so it included= the removal of the __fileinit stuff that didn&#39;t happen until after 2.0= 58. =A0You can find a proper win32.mak here:=A0<a href=3D"https://gist.gith= ub.com/3816217ffd041d62d6bd">https://gist.github.com/3816217ffd041d62d6bd</= a></div> <div><br></div><div>For anyone coming across this thread from the archive, = use the patch file also in the above link instead of the whole file replace= ment. Unfortunately 2.059 won&#39;t include the changes (I&#39;m kind of at= a loss with how to proceed) but the win32.mak differs from the 2.058 versi= on so using the patch is necessary in order to not break things.</div> <div><br></div><div>Regards,</div><div>Brad Anderson</div> --f46d04083f4b377a3804bc790af8--
Mar 30 2012
prev sibling parent "Gleb" <s4mmael gmail.com> writes:
On Friday, 30 March 2012 at 17:19:30 UTC, Brad Anderson wrote:
 You can find a proper
 win32.mak here: https://gist.github.com/3816217ffd041d62d6bd

Mar 30 2012