A valid code that won't run?

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 24 23:42:25 PDT 2015


On 24 Apr 2015 22:55, "Steven Schveighoffer via Digitalmars-d" <
digitalmars-d at puremagic.com> wrote:
>
> 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.
>

Doesn't DMD use dmd.conf for these?  Libc may be called something else,
libm may or may not be part of libc, and librt may not exist at all.

For the first two, the system C compiler will know this information and
implicitly link when you run 'cc mydprog.o -lphobos2'.  For librt, it's
less likely so you'll need '-L-lrt' in your D environment vars.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150425/59db450a/attachment-0001.html>


More information about the Digitalmars-d mailing list