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
parent reply "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
parent reply Brad Anderson <eco gnuk.net> writes:
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
Mar 15 2012
parent reply 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.
I tried to rebuild Phobos using the instructions from this thread, but I 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?
Mar 30 2012
parent reply Brad Anderson <eco gnuk.net> writes:
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.
I tried to rebuild Phobos using the instructions from this thread, but I 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
Mar 30 2012
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
It worked like a charm! Thanks a lot!
Mar 30 2012