compilation issues (dmd, rdmd, ldc2)

kraxli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 21 13:51:27 PST 2016


On Sunday, 21 February 2016 at 21:35:55 UTC, anonymous wrote:
> On Sunday, 21 February 2016 at 21:21:30 UTC, kraxli wrote:
>> Thanks for coming back on that! The problem is the 
>> consoled-package which has the library:
>> ~/.dub/packages/consoled-1.0.0/libconsoled.a
>>
>> So I link it (or aim to do it ;-) ) but dmd cannot find it:
>>
>> $ dmd -I~/.dub/packages/consoled-1.0.0/source  
>> -L-l~/.dub/packages/consoled-1.0.0/libconsoled  appX.d
>> /usr/bin/ld: cannot find 
>> -l~/.dub/packages/consoled-1.0.0/libconsoled
>> collect2: error: ld returned 1 exit status
>> --- errorlevel 1
>
> I don't think it works like that. If I remember correctly, you 
> can either
> a) do it the linker way: `dmd 
> -L-L~/.dub/packages/consoled-1.0.0/ -L-lconsoled ...`, or
> b) do it the dmd way: `dmd 
> ~/.dub/packages/consoled-1.0.0/libconsoled.a ...`.

b) works! :-) Many thanks!!
a) doesn't work, I need to search for more information on linking 
as I would like to understand these kind of basics in D :-). The 
books I consulted so far (Learn D and D cookbook) did not help me 
to understand the linking so far ...

>
>>> I don't know what's going on there, but there shouldn't be a 
>>> std/range.d with recent versions of phobos. It's a package 
>>> since 2.067.0. Maybe a leftover from a previous installation?
>>
>> I just reinstalled it and it seems as it would have installed 
>> in the directory mentioned by ldc2:
>> -- Installing: /usr/local/include/d/std/range
>> -- Installing: /usr/local/include/d/std/range/primitives.d
>> -- Installing: /usr/local/include/d/std/range/package.d
>> -- Installing: /usr/local/include/d/std/range/interfaces.d
>
> But is there a file /usr/local/include/d/std/range.d? If so, 
> that's apparently not from your latest install, and it may 
> confuse ldc. If there is no such file, then I can't make any 
> sense of the error messages.

Oh yes there is such a file (and others). I need to clean these 
redundant files up ... Thanks here as well!




More information about the Digitalmars-d-learn mailing list