imports && -run [Bug?]

Andrew Edwards via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 12 23:27:12 PDT 2016


On 5/13/16 3:10 PM, tsbockman wrote:
> On Friday, 13 May 2016 at 01:16:36 UTC, Andrew Edwards wrote:
>> command: dmd -run mod inc
>>
>> output:
>>
>> Undefined symbols for architecture x86_64:
>>   "_D3inc5printFZv", referenced from:
>>       __Dmain in mod.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> --- errorlevel 1
>>
>> None of the variations of imports work when compiled with the -run
>> switch but all work perfectly well without it.
>
> According to the DMD compiler manual, the -run switch only accepts a
> single source file:
>      -run srcfile args...
>
> After the first source file, any further arguments passed to DMD will be
> interpreted as arguments to be passed to the program being run.

Thanks, I guess I just expected it to work the same as rdmd does and 
didn't even bother trying to look in the manual regarding this.

I fail to see why the compiler would be less capable at this task than 
rdmd. Since it is already build to accept multiple input files and knows 
more about what's going on during compilation than rdmd will ever know, 
in does not make sense that it should inferior in this regard: yet rdmd 
takes one imput file and sorts out all dependencies.

> Have you tried using DUB? It has lots of convenient features, including
> a `run` command that supports multiple source files:
>      http://code.dlang.org/docs/commandline#run

I've used dub before but it is not desired for what I'm trying to do. 
rdmd does the trick. Thank you.


More information about the Digitalmars-d-learn mailing list