Summary: calling rdmd from different folder
--- Comment #0 from crypticmetapho...@gmail.com 2010-12-19 18:47:59 PST ---
Calling rdmd from outside the folder in which the main source file resides in,
and the main source file imports another file, causes an error.
Steps to reproduce:
Steps to reproduce & Actual results::
// end main.d
// end test.d
// If I'm in a shell, and I do this, I get an error:
src\main.d(2): Error: module test is in file 'test.d' which cannot be read
import path = C:\D\dmd2\windows\bin\..\..\src\phobos
import path = C:\D\dmd2\windows\bin\..\..\src\druntime\import
// If I call this, I generate a main.d.deps file that can't find main.d
// last line of main.d.deps: "Error: cannot read file main.d"
...\projectfolder>rdmd -I(absolute path to src) main.d
// but if I do this, it works:
// also works with
...\projectfolder\src>dmd main.d test.d // compiles
The application should work because the location of the main and the other
files file is known when the program is ran. Or, at least, you should be able
to specify a directory as an argument to rdmd in which rdmd will work.
Build Date & Platform:
* rdmd build 20101220
* dmd 2.050
* Windows XP Pro
I've found a workaround. I start a batch file to which I pass as argument the
absolute path to the src directory. I go to that directory in the batch file,
and execute rdmd.
Example batch file:
rdmd --build-only --chatty -of%1..\bin\main -I%1..\inc main.d
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------