Strange behaviour of rdmd vs. dmd concerning main function

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 9 12:48:50 PST 2017


Dne 9.2.2017 v 21:10 berni via Digitalmars-d-learn napsal(a):

> On Thursday, 9 February 2017 at 19:10:55 UTC, Daniel Kozak wrote:
>> Dne 9.2.2017 v 17:20 berni via Digitalmars-d-learn napsal(a):
>>
>>>> [...]
>>>
>>> Ah ok, I understand. So calling with "dmd Special/special.d 
>>> Common/common.d" works.
>>>
>>> But when I compile common.d to common.o (with dmd -c common.d) and 
>>> remove common.d after that is there still a possibility to link? The 
>>> obvious doesn't work:
>>>
>>>> [...]
>>>
>> Thats ok too, you still need to add -ICommon
>> dmd -ICommon Special/special.d Common/common.o
>
> Doesn't work here:
>
>> $> dmd -ICommon Special/special.d Common/common.o
>> Special/special.d(4): Error: module common is in file 'common.d' 
>> which cannot be read
>> import path[0] = Common
>> import path[1] = /usr/include/dmd/phobos
>> import path[2] = /usr/include/dmd/druntime/import
Which version of dmd you have?
It should work, you probably do something wrong, I have use your example 
files so do you change them somehow?


More information about the Digitalmars-d-learn mailing list