Thread overview
How to include curl.lib?
Jan 14, 2019
Head Scratcher
Jan 17, 2019
Head Scratcher
Jan 17, 2019
Andre Pany
Jan 18, 2019
Head Scratcher
Jan 18, 2019
Andre Pany
January 14, 2019
The following text is in the source code for curl.d:

Windows x86 note:
A DMD compatible libcurl static library can be downloaded from the dlang.org
$(LINK2 http://downloads.dlang.org/other/index.html, download archive page).

I downloaded that static library. How do I link it into my D project?  Is it something I can put into dub.json?

January 17, 2019
On Monday, 14 January 2019 at 18:45:27 UTC, Head Scratcher wrote:
> The following text is in the source code for curl.d:
>
> Windows x86 note:
> A DMD compatible libcurl static library can be downloaded from the dlang.org
> $(LINK2 http://downloads.dlang.org/other/index.html, download archive page).
>
> I downloaded that static library. How do I link it into my D project?  Is it something I can put into dub.json?

It would be nice to compile my app into one EXE file including std.curl and curl.lib. Does nobody know how to do this?
January 17, 2019
On Thursday, 17 January 2019 at 20:05:27 UTC, Head Scratcher wrote:
> On Monday, 14 January 2019 at 18:45:27 UTC, Head Scratcher wrote:
>> The following text is in the source code for curl.d:
>>
>> Windows x86 note:
>> A DMD compatible libcurl static library can be downloaded from the dlang.org
>> $(LINK2 http://downloads.dlang.org/other/index.html, download archive page).
>>
>> I downloaded that static library. How do I link it into my D project?  Is it something I can put into dub.json?
>
> It would be nice to compile my app into one EXE file including std.curl and curl.lib. Does nobody know how to do this?

You do not need to specify curl.lib but you have to bundle your executable with curl.dll.
Recent Windows 10 versions might even come with curl.dll but I am not 100% sure.

Kind regards
Andre
January 18, 2019
On Thursday, 17 January 2019 at 20:42:48 UTC, Andre Pany wrote:

> You do not need to specify curl.lib but you have to bundle your executable with curl.dll.
> Recent Windows 10 versions might even come with curl.dll but I am not 100% sure.


Thank you for your reply, Andre. My computer has curl.exe in the Windows\System32 folder, but I'm not sure I can guarantee that any users of my EXE will have that.

I am writing a utility program that performs FTP. According to the std.curl source code, curl.lib can be statically linked. Is that not the case?

January 18, 2019
On Friday, 18 January 2019 at 15:49:09 UTC, Head Scratcher wrote:
> On Thursday, 17 January 2019 at 20:42:48 UTC, Andre Pany wrote:
>
>> You do not need to specify curl.lib but you have to bundle your executable with curl.dll.
>> Recent Windows 10 versions might even come with curl.dll but I am not 100% sure.
>
>
> Thank you for your reply, Andre. My computer has curl.exe in the Windows\System32 folder, but I'm not sure I can guarantee that any users of my EXE will have that.
>
> I am writing a utility program that performs FTP. According to the std.curl source code, curl.lib can be statically linked. Is that not the case?

I thought also the libcurl.dll is available but it doesn't seems so. The curl executable does not have any use in your case.
I am not an expert in this area but I think it should be possible, but I do not how.
I can only give you the advice to start with the dll approach. At any point later you can just switch to the static linking approach.
Depending on the license type of your application you might also check whether you are allowed to statically bind curl.

Kind regards
Andre