Compiling D through command line

Jeremy DeHaan dehaan.jeremiah at gmail.com
Fri Mar 7 09:53:32 PST 2014


On Friday, 7 March 2014 at 16:59:30 UTC, Bauss wrote:
> What arguments would I do to compile a d project through 
> command line. Been trying a few things, but can't get it 
> working.
>
> I always get "Error: cannot read file x"
>
> Read around the net and it most says it's an installation error 
> and that reinstalling should fix it, but it works when 
> compiling through a few IDE's so I assume it's mistake of my 
> own.
>
> Tried like this:
> -c c:\testproject\main.d -m32 -ofc:\testd\out.exe
>
> And tried doing -v and it shows the correct information.
>
> Anyone who got an example to achieve it. The documents doesn't 
> explain it proper IMO as there is no example on compiling 
> manual.



I would say that you should make sure that the files are where
you expect them to be. When using the console, iff you're in the
source directory you shouldn't need to specify a full path for
those files at least, which could help the compiler find them.
You can still specify the output directory for the exe.

On a side note, why use the m32 switch on Windows? That's the
default, so it isn't needed.


More information about the Digitalmars-d-learn mailing list