imports && -run [Bug?]

tsbockman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 12 23:10:08 PDT 2016


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.

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


More information about the Digitalmars-d-learn mailing list