A valid code that won't run?

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 24 13:52:16 PDT 2015


On 4/24/15 4:36 PM, Dicebot wrote:
> On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote:
>> If pragma(lib, "libcurl"); doesn't work normally, then we should
>> remove std.net.curl, and put it in dub.
>
> It was a historical mistake, discussed many time over and over. Yes, it
> shouldn't be in Phobos. No, we can't remove it now that easily.

deprecated("Please use dub for curl");
module std.net.curl

// this will cause an error until you install the binding, then you can
// go through your imports and update them.
public import some.dub.project;

> As for pragma(lib) - it can never work "normally". Linking 3d-party
> libraries is very platform-specific task that causes great deal of
> complexity in build systems. It can't be replaced by a single trivial
> compiler pragma. There is a reason nothing but Windows build of DMD
> supports it.

You are right about not having pragma(lib anywhere but windows, but we 
do depend on 3rd party libs -- libc, libm, librt, etc. They are just 
always in the right places.

I'm not quite sure where libcurl would be except /usr/lib, and why 
-L-lcurl wouldn't work (and therefore pragma(lib ). Seems like all the 
issues are for people who custom-build or custom-install libcurl.

But I'm not really concerned about that. AFAIK, we have no other 3rd 
party dependencies like this, std.net.curl sticks out blatantly as 
something that was done in error, and we should correct it.

-Steve


More information about the Digitalmars-d mailing list